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(id = nil, owner_id = nil, name = nil, notes = nil, pricing_model_type = nil, price = nil, currency = nil) ⇒ EntitiesPricingModelResponse
constructor
A new instance of EntitiesPricingModelResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(id = nil, owner_id = nil, name = nil, notes = nil, pricing_model_type = nil, price = nil, currency = 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(id = nil, owner_id = nil, name = nil, notes = nil, pricing_model_type = nil, price = nil, currency = nil) @id = id @owner_id = owner_id @name = name @notes = notes @pricing_model_type = pricing_model_type @price = price @currency = currency end |
Instance Attribute Details
#currency ⇒ String
currency symbol, as per ISO-4217
31 32 33 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 31 def currency @currency end |
#id ⇒ Integer
id of PricingModel
7 8 9 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 7 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
11 12 13 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 11 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
23 24 25 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 23 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 |
# File 'lib/gonebusy/models/entities_pricing_model_response.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash id = hash['id'] owner_id = hash['owner_id'] name = hash['name'] notes = hash['notes'] pricing_model_type = hash['pricing_model_type'] price = hash['price'] currency = hash['currency'] # Create object from extracted values EntitiesPricingModelResponse.new(id, owner_id, name, notes, pricing_model_type, price, currency) 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["id"] = "id" @_hash["owner_id"] = "owner_id" @_hash["name"] = "name" @_hash["notes"] = "notes" @_hash["pricing_model_type"] = "pricing_model_type" @_hash["price"] = "price" @_hash["currency"] = "currency" end @_hash end |