Class: SuggestGrid::TypeRequestBody

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/suggestgrid/models/type_request_body.rb

Overview

Options for creating a type.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(rating = nil) ⇒ TypeRequestBody

Returns a new instance of TypeRequestBody.



19
20
21
# File 'lib/suggestgrid/models/type_request_body.rb', line 19

def initialize(rating = nil)
  @rating = rating
end

Instance Attribute Details

#ratingString

The rating type of the type. Could be “explicit” or “implicit”, where “implicit” is the default.

Returns:



10
11
12
# File 'lib/suggestgrid/models/type_request_body.rb', line 10

def rating
  @rating
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



24
25
26
27
28
29
30
31
32
# File 'lib/suggestgrid/models/type_request_body.rb', line 24

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  rating = hash['rating']

  # Create object from extracted values.
  TypeRequestBody.new(rating)
end

.namesObject

A mapping from model property names to API property names.



13
14
15
16
17
# File 'lib/suggestgrid/models/type_request_body.rb', line 13

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['rating'] = 'rating'
  @_hash
end