Class: SuggestGrid::GetTypesResponse
- Defined in:
- lib/suggest_grid/models/get_types_response.rb
Instance Attribute Summary collapse
-
#types ⇒ List of String
The list of type names.
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(types = nil, additional_properties = {}) ⇒ GetTypesResponse
constructor
A new instance of GetTypesResponse.
Methods inherited from BaseModel
#method_missing, #respond_to?, #to_hash, #to_json
Constructor Details
#initialize(types = nil, additional_properties = {}) ⇒ GetTypesResponse
Returns a new instance of GetTypesResponse.
18 19 20 21 22 23 24 |
# File 'lib/suggest_grid/models/get_types_response.rb', line 18 def initialize(types = nil, additional_properties = {}) @types = types # 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
#types ⇒ List of String
The list of type names
7 8 9 |
# File 'lib/suggest_grid/models/get_types_response.rb', line 7 def types @types end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/suggest_grid/models/get_types_response.rb', line 27 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash types = hash["types"] # Clean out expected properties from Hash names.values.each {|k| hash.delete(k)} # Create object from extracted values GetTypesResponse.new(types, hash) end end |
.names ⇒ Object
A mapping from model property names to API property names
10 11 12 13 14 15 16 |
# File 'lib/suggest_grid/models/get_types_response.rb', line 10 def self.names if @hash.nil? @hash = {} @hash["types"] = "types" end @hash end |