Class: Gonebusy::EntitiesPricingModelResponse
- Defined in:
- lib/gonebusy/models/entities_pricing_model_response.rb
Instance Attribute Summary collapse
-
#currency ⇒ String
currency symbol, as per ISO-4217.
-
#id ⇒ Integer
id of PricingModel.
-
#name ⇒ String
name of PricingModel.
-
#notes ⇒ String
notes and description.
-
#owner_id ⇒ Integer
id of owner of PricingModel.
-
#price ⇒ String
price/rate.
-
#pricing_model_type ⇒ String
type of PricingModel.
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(currency = nil, id = nil, name = nil, notes = nil, owner_id = nil, price = nil, pricing_model_type = nil) ⇒ EntitiesPricingModelResponse
constructor
A new instance of EntitiesPricingModelResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(currency = nil, id = nil, name = nil, notes = nil, owner_id = nil, price = nil, pricing_model_type = nil) ⇒ EntitiesPricingModelResponse
Returns a new instance of EntitiesPricingModelResponse.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 48 def initialize(currency = nil, id = nil, name = nil, notes = nil, owner_id = nil, price = nil, pricing_model_type = nil) @currency = currency @id = id @name = name @notes = notes @owner_id = owner_id @price = price @pricing_model_type = pricing_model_type end |
Instance Attribute Details
#currency ⇒ String
currency symbol, as per ISO-4217
7 8 9 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 7 def currency @currency end |
#id ⇒ Integer
id of PricingModel
11 12 13 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 11 def id @id end |
#name ⇒ String
name of PricingModel
15 16 17 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 15 def name @name end |
#notes ⇒ String
notes and description
19 20 21 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 19 def notes @notes end |
#owner_id ⇒ Integer
id of owner of PricingModel
23 24 25 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 23 def owner_id @owner_id end |
#price ⇒ String
price/rate
27 28 29 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 27 def price @price end |
#pricing_model_type ⇒ String
type of PricingModel
31 32 33 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 31 def pricing_model_type @pricing_model_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 65 def self.from_hash(hash) if hash == nil nil else # Extract variables from the hash currency = hash["currency"] id = hash["id"] name = hash["name"] notes = hash["notes"] owner_id = hash["owner_id"] price = hash["price"] pricing_model_type = hash["pricing_model_type"] # Create object from extracted values EntitiesPricingModelResponse.new(currency, id, name, notes, owner_id, price, pricing_model_type) end end |
.names ⇒ Object
A mapping from model property names to API property names
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 34 def self.names if @hash.nil? @hash = {} @hash["currency"] = "currency" @hash["id"] = "id" @hash["name"] = "name" @hash["notes"] = "notes" @hash["owner_id"] = "owner_id" @hash["price"] = "price" @hash["pricing_model_type"] = "pricing_model_type" end @hash end |