Class: Gonebusy::CreatePricingModelBody
- Defined in:
- lib/gonebusy/models/create_pricing_model_body.rb
Instance Attribute Summary collapse
-
#currency ⇒ String
3 Letter ISO Currency Code.
-
#name ⇒ String
PricingModel Name.
-
#notes ⇒ String
Optional Notes Field.
-
#price ⇒ Float
Price.
-
#type ⇒ String
Type of PricingModel.
-
#user_id ⇒ Integer
Create a PricingModel for this User Id.
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(name = nil, type = nil, user_id = nil, notes = nil, price = nil, currency = nil) ⇒ CreatePricingModelBody
constructor
A new instance of CreatePricingModelBody.
Methods inherited from BaseModel
Constructor Details
#initialize(name = nil, type = nil, user_id = nil, notes = nil, price = nil, currency = nil) ⇒ CreatePricingModelBody
Returns a new instance of CreatePricingModelBody.
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 43 def initialize(name = nil, type = nil, user_id = nil, notes = nil, price = nil, currency = nil) @name = name @type = type @user_id = user_id @notes = notes @price = price @currency = currency end |
Instance Attribute Details
#currency ⇒ String
3 Letter ISO Currency Code
27 28 29 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 27 def currency @currency end |
#name ⇒ String
PricingModel Name
7 8 9 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 7 def name @name end |
#notes ⇒ String
Optional Notes Field
19 20 21 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 19 def notes @notes end |
#price ⇒ Float
Price
23 24 25 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 23 def price @price end |
#type ⇒ String
Type of PricingModel
11 12 13 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 11 def type @type end |
#user_id ⇒ Integer
Create a PricingModel for this User Id. You must be authorized to manage this User Id.
15 16 17 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 15 def user_id @user_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash name = hash['name'] type = hash['type'] user_id = hash['user_id'] notes = hash['notes'] price = hash['price'] currency = hash['currency'] # Create object from extracted values CreatePricingModelBody.new(name, type, user_id, notes, price, currency) end |
.names ⇒ Object
A mapping from model property names to API property names
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/gonebusy/models/create_pricing_model_body.rb', line 30 def self.names if @_hash.nil? @_hash = {} @_hash["name"] = "name" @_hash["type"] = "type" @_hash["user_id"] = "user_id" @_hash["notes"] = "notes" @_hash["price"] = "price" @_hash["currency"] = "currency" end @_hash end |