Class: Asdawqw::ReservationCommissionsNotificationModel

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/asdawqw/models/reservation_commissions_notification_model.rb

Overview

ReservationCommissionsNotificationModel Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(channel_commission = nil, bp_commission = nil) ⇒ ReservationCommissionsNotificationModel

Returns a new instance of ReservationCommissionsNotificationModel.



25
26
27
28
29
# File 'lib/asdawqw/models/reservation_commissions_notification_model.rb', line 25

def initialize(channel_commission = nil,
               bp_commission = nil)
  @channel_commission = channel_commission
  @bp_commission = bp_commission
end

Instance Attribute Details

#bp_commissionFloat

BookingPal commission

Returns:

  • (Float)


15
16
17
# File 'lib/asdawqw/models/reservation_commissions_notification_model.rb', line 15

def bp_commission
  @bp_commission
end

#channel_commissionFloat

Channel commission

Returns:

  • (Float)


11
12
13
# File 'lib/asdawqw/models/reservation_commissions_notification_model.rb', line 11

def channel_commission
  @channel_commission
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/asdawqw/models/reservation_commissions_notification_model.rb', line 32

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  channel_commission = hash['channelCommission']
  bp_commission = hash['bpCommission']

  # Create object from extracted values.
  ReservationCommissionsNotificationModel.new(channel_commission,
                                              bp_commission)
end

.namesObject

A mapping from model property names to API property names.



18
19
20
21
22
23
# File 'lib/asdawqw/models/reservation_commissions_notification_model.rb', line 18

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['channel_commission'] = 'channelCommission'
  @_hash['bp_commission'] = 'bpCommission'
  @_hash
end