Class: Asdawqw::ReservationRateNotifcationModel
- Defined in:
- lib/asdawqw/models/reservation_rate_notifcation_model.rb
Overview
ReservationRateNotifcationModel Model.
Instance Attribute Summary collapse
-
#net_rate ⇒ Float
Net rate (rate which PM will get - so without any additional commissions).
-
#new_published_rack_rate ⇒ Float
New published rack rate (rate which guest paid - rate with all commissions).
-
#original_rack_rate ⇒ Float
Original rack rate.
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(original_rack_rate = nil, net_rate = nil, new_published_rack_rate = nil) ⇒ ReservationRateNotifcationModel
constructor
A new instance of ReservationRateNotifcationModel.
Methods inherited from BaseModel
Constructor Details
#initialize(original_rack_rate = nil, net_rate = nil, new_published_rack_rate = nil) ⇒ ReservationRateNotifcationModel
Returns a new instance of ReservationRateNotifcationModel.
32 33 34 35 36 37 38 |
# File 'lib/asdawqw/models/reservation_rate_notifcation_model.rb', line 32 def initialize(original_rack_rate = nil, net_rate = nil, new_published_rack_rate = nil) @original_rack_rate = original_rack_rate @net_rate = net_rate @new_published_rack_rate = new_published_rack_rate end |
Instance Attribute Details
#net_rate ⇒ Float
Net rate (rate which PM will get - so without any additional commissions).
16 17 18 |
# File 'lib/asdawqw/models/reservation_rate_notifcation_model.rb', line 16 def net_rate @net_rate end |
#new_published_rack_rate ⇒ Float
New published rack rate (rate which guest paid - rate with all commissions).
21 22 23 |
# File 'lib/asdawqw/models/reservation_rate_notifcation_model.rb', line 21 def new_published_rack_rate @new_published_rack_rate end |
#original_rack_rate ⇒ Float
Original rack rate. Rate received from PMS (rate without additional channel commission or any additional markup)
12 13 14 |
# File 'lib/asdawqw/models/reservation_rate_notifcation_model.rb', line 12 def original_rack_rate @original_rack_rate end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/asdawqw/models/reservation_rate_notifcation_model.rb', line 41 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. original_rack_rate = hash['originalRackRate'] net_rate = hash['netRate'] new_published_rack_rate = hash['newPublishedRackRate'] # Create object from extracted values. ReservationRateNotifcationModel.new(original_rack_rate, net_rate, new_published_rack_rate) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 29 30 |
# File 'lib/asdawqw/models/reservation_rate_notifcation_model.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['original_rack_rate'] = 'originalRackRate' @_hash['net_rate'] = 'netRate' @_hash['new_published_rack_rate'] = 'newPublishedRackRate' @_hash end |