Class: Asdawqw::ReservationTaxNotificationModel
- Defined in:
- lib/asdawqw/models/reservation_tax_notification_model.rb
Overview
Model used for taxes in reservation push notification
Instance Attribute Summary collapse
-
#id ⇒ String
Tax altID (alt ID which PMS sent over API).
-
#name ⇒ String
Tax name.
-
#value ⇒ Float
Tax value.
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, value = nil, id = nil) ⇒ ReservationTaxNotificationModel
constructor
A new instance of ReservationTaxNotificationModel.
Methods inherited from BaseModel
Constructor Details
#initialize(name = nil, value = nil, id = nil) ⇒ ReservationTaxNotificationModel
Returns a new instance of ReservationTaxNotificationModel.
30 31 32 33 34 35 36 |
# File 'lib/asdawqw/models/reservation_tax_notification_model.rb', line 30 def initialize(name = nil, value = nil, id = nil) @id = id @name = name @value = value end |
Instance Attribute Details
#id ⇒ String
Tax altID (alt ID which PMS sent over API)
11 12 13 |
# File 'lib/asdawqw/models/reservation_tax_notification_model.rb', line 11 def id @id end |
#name ⇒ String
Tax name
15 16 17 |
# File 'lib/asdawqw/models/reservation_tax_notification_model.rb', line 15 def name @name end |
#value ⇒ Float
Tax value
19 20 21 |
# File 'lib/asdawqw/models/reservation_tax_notification_model.rb', line 19 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/asdawqw/models/reservation_tax_notification_model.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash['name'] value = hash['value'] id = hash['id'] # Create object from extracted values. ReservationTaxNotificationModel.new(name, value, id) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 28 |
# File 'lib/asdawqw/models/reservation_tax_notification_model.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['value'] = 'value' @_hash end |