Class: SuggestGrid::BulkPostError
- Defined in:
- lib/suggest_grid/models/bulk_post_error.rb
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, additional_properties = {}) ⇒ BulkPostError
constructor
A new instance of BulkPostError.
Methods inherited from BaseModel
#method_missing, #respond_to?, #to_hash, #to_json
Constructor Details
#initialize(message = nil, value = nil, error = nil, additional_properties = {}) ⇒ BulkPostError
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/suggest_grid/models/bulk_post_error.rb', line 28 def initialize( = nil, value = nil, error = nil, additional_properties = {}) = @value = value @error = error # Add additional model properties to the instance additional_properties.each {|name, value| instance_variable_set("@#{name}", value)} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SuggestGrid::BaseModel
Instance Attribute Details
#error ⇒ Object
Programatic description of the error.
15 16 17 |
# File 'lib/suggest_grid/models/bulk_post_error.rb', line 15 def error @error end |
#message ⇒ String
Message of the response.
7 8 9 |
# File 'lib/suggest_grid/models/bulk_post_error.rb', line 7 def end |
#value ⇒ Object
The cause of the error.
11 12 13 |
# File 'lib/suggest_grid/models/bulk_post_error.rb', line 11 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/suggest_grid/models/bulk_post_error.rb', line 41 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash = hash["message"] value = hash["value"] error = hash["error"] # Clean out expected properties from Hash names.values.each {|k| hash.delete(k)} # Create object from extracted values BulkPostError.new(, value, error, hash) end end |
.names ⇒ Object
A mapping from model property names to API property names
18 19 20 21 22 23 24 25 26 |
# File 'lib/suggest_grid/models/bulk_post_error.rb', line 18 def self.names if @hash.nil? @hash = {} @hash["message"] = "message" @hash["value"] = "value" @hash["error"] = "error" end @hash end |