Class: Gonebusy::UpdatePricingModelByIdBody

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/gonebusy/models/update_pricing_model_by_id_body.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(currency = nil, name = nil, notes = nil, price = nil) ⇒ UpdatePricingModelByIdBody

Returns a new instance of UpdatePricingModelByIdBody.



33
34
35
36
37
38
39
40
41
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 33

def initialize(currency = nil,
               name = nil,
               notes = nil,
               price = nil)
  @currency = currency
  @name = name
  @notes = notes
  @price = price
end

Instance Attribute Details

#currencyString

3 Letter ISO Currency Code

Returns:



7
8
9
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 7

def currency
  @currency
end

#nameString

PricingModel Name

Returns:



11
12
13
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 11

def name
  @name
end

#notesString

Optional Notes Field

Returns:



15
16
17
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 15

def notes
  @notes
end

#priceFloat

Price

Returns:

  • (Float)


19
20
21
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 19

def price
  @price
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 44

def self.from_hash(hash)
  if hash == nil
    nil
  else
    # Extract variables from the hash

    currency = hash["currency"]
    name = hash["name"]
    notes = hash["notes"]
    price = hash["price"]

    # Create object from extracted values

    UpdatePricingModelByIdBody.new(currency,
                                   name,
                                   notes,
                                   price)
  end
end

.namesObject

A mapping from model property names to API property names



22
23
24
25
26
27
28
29
30
31
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 22

def self.names
  if @hash.nil?
    @hash = {}
    @hash["currency"] = "currency"
    @hash["name"] = "name"
    @hash["notes"] = "notes"
    @hash["price"] = "price"
  end
  @hash
end