Class: SuggestGrid::BulkPostError
- Defined in:
- lib/suggestgrid/models/bulk_post_error.rb
Overview
Error response returned due to bulk post schema validations.
Instance Attribute Summary collapse
-
#error ⇒ Object
Programatic description of the error.
-
#message ⇒ String
Message of the response.
-
#value ⇒ Object
The cause of the error.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(message = nil, value = nil, error = nil) ⇒ BulkPostError
constructor
A new instance of BulkPostError.
Methods inherited from BaseModel
Constructor Details
#initialize(message = nil, value = nil, error = nil) ⇒ BulkPostError
Returns a new instance of BulkPostError.
28 29 30 31 32 33 34 |
# File 'lib/suggestgrid/models/bulk_post_error.rb', line 28 def initialize( = nil, value = nil, error = nil) @message = @value = value @error = error end |
Instance Attribute Details
#error ⇒ Object
Programatic description of the error.
17 18 19 |
# File 'lib/suggestgrid/models/bulk_post_error.rb', line 17 def error @error end |
#message ⇒ String
Message of the response.
9 10 11 |
# File 'lib/suggestgrid/models/bulk_post_error.rb', line 9 def @message end |
#value ⇒ Object
The cause of the error.
13 14 15 |
# File 'lib/suggestgrid/models/bulk_post_error.rb', line 13 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/suggestgrid/models/bulk_post_error.rb', line 37 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash['message'] value = hash['value'] error = hash['error'] # Create object from extracted values. BulkPostError.new(, value, error) end |
.names ⇒ Object
A mapping from model property names to API property names.
20 21 22 23 24 25 26 |
# File 'lib/suggestgrid/models/bulk_post_error.rb', line 20 def self.names @_hash = {} if @_hash.nil? @_hash['message'] = 'message' @_hash['value'] = 'value' @_hash['error'] = 'error' @_hash end |