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(name = nil, notes = nil, price = nil, currency = 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(name = nil,
               notes = nil,
               price = nil,
               currency = nil)
  @name = name
  @notes = notes
  @price = price
  @currency = currency
end

Instance Attribute Details

#currencyString

3 Letter ISO Currency Code

Returns:



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

def currency
  @currency
end

#nameString

PricingModel Name

Returns:



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

def name
  @name
end

#notesString

Optional Notes Field

Returns:



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

def notes
  @notes
end

#priceFloat

Price

Returns:

  • (Float)


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

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
# File 'lib/gonebusy/models/update_pricing_model_by_id_body.rb', line 44

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash
  name = hash['name']
  notes = hash['notes']
  price = hash['price']
  currency = hash['currency']

  # Create object from extracted values
  UpdatePricingModelByIdBody.new(name,
                                 notes,
                                 price,
                                 currency)
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["name"] = "name"
    @_hash["notes"] = "notes"
    @_hash["price"] = "price"
    @_hash["currency"] = "currency"
  end
  @_hash
end