Class: Ingenico::Connect::SDK::Domain::Definitions::LodgingData

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#chargesArray<Ingenico::Connect::SDK::Domain::Definitions::LodgingCharge>



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def charges
  @charges
end

#check_in_dateString



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def check_in_date
  @check_in_date
end

#check_out_dateString



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def check_out_date
  @check_out_date
end

#folio_numberString



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def folio_number
  @folio_number
end

#is_confirmed_reservationtrue/false



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def is_confirmed_reservation
  @is_confirmed_reservation
end

#is_facility_fire_safety_conformtrue/false



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def is_facility_fire_safety_conform
  @is_facility_fire_safety_conform
end

#is_no_showtrue/false



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def is_no_show
  @is_no_show
end

#is_preference_smoking_roomtrue/false



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def is_preference_smoking_room
  @is_preference_smoking_room
end

#number_of_adultsInteger



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def number_of_adults
  @number_of_adults
end

#number_of_nightsInteger



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def number_of_nights
  @number_of_nights
end

#number_of_roomsInteger



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def number_of_rooms
  @number_of_rooms
end

#program_codeString



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def program_code
  @program_code
end

#property_customer_service_phone_numberString



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def property_customer_service_phone_number
  @property_customer_service_phone_number
end

#property_phone_numberString



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def property_phone_number
  @property_phone_number
end

#renter_nameString



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def renter_name
  @renter_name
end

#roomsArray<Ingenico::Connect::SDK::Domain::Definitions::LodgingRoom>



30
31
32
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 30

def rooms
  @rooms
end

Instance Method Details

#from_hash(hash) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 86

def from_hash(hash)
  super
  if hash.has_key? 'charges'
    raise TypeError, "value '%s' is not an Array" % [hash['charges']] unless hash['charges'].is_a? Array
    @charges = []
    hash['charges'].each do |e|
      @charges << Ingenico::Connect::SDK::Domain::Definitions::LodgingCharge.new_from_hash(e)
    end
  end
  if hash.has_key? 'checkInDate'
    @check_in_date = hash['checkInDate']
  end
  if hash.has_key? 'checkOutDate'
    @check_out_date = hash['checkOutDate']
  end
  if hash.has_key? 'folioNumber'
    @folio_number = hash['folioNumber']
  end
  if hash.has_key? 'isConfirmedReservation'
    @is_confirmed_reservation = hash['isConfirmedReservation']
  end
  if hash.has_key? 'isFacilityFireSafetyConform'
    @is_facility_fire_safety_conform = hash['isFacilityFireSafetyConform']
  end
  if hash.has_key? 'isNoShow'
    @is_no_show = hash['isNoShow']
  end
  if hash.has_key? 'isPreferenceSmokingRoom'
    @is_preference_smoking_room = hash['isPreferenceSmokingRoom']
  end
  if hash.has_key? 'numberOfAdults'
    @number_of_adults = hash['numberOfAdults']
  end
  if hash.has_key? 'numberOfNights'
    @number_of_nights = hash['numberOfNights']
  end
  if hash.has_key? 'numberOfRooms'
    @number_of_rooms = hash['numberOfRooms']
  end
  if hash.has_key? 'programCode'
    @program_code = hash['programCode']
  end
  if hash.has_key? 'propertyCustomerServicePhoneNumber'
    @property_customer_service_phone_number = hash['propertyCustomerServicePhoneNumber']
  end
  if hash.has_key? 'propertyPhoneNumber'
    @property_phone_number = hash['propertyPhoneNumber']
  end
  if hash.has_key? 'renterName'
    @renter_name = hash['renterName']
  end
  if hash.has_key? 'rooms'
    raise TypeError, "value '%s' is not an Array" % [hash['rooms']] unless hash['rooms'].is_a? Array
    @rooms = []
    hash['rooms'].each do |e|
      @rooms << Ingenico::Connect::SDK::Domain::Definitions::LodgingRoom.new_from_hash(e)
    end
  end
end

#to_hHash



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/ingenico/connect/sdk/domain/definitions/lodging_data.rb', line 65

def to_h
  hash = super
  hash['charges'] = @charges.collect{|val| val.to_h} unless @charges.nil?
  hash['checkInDate'] = @check_in_date unless @check_in_date.nil?
  hash['checkOutDate'] = @check_out_date unless @check_out_date.nil?
  hash['folioNumber'] = @folio_number unless @folio_number.nil?
  hash['isConfirmedReservation'] = @is_confirmed_reservation unless @is_confirmed_reservation.nil?
  hash['isFacilityFireSafetyConform'] = @is_facility_fire_safety_conform unless @is_facility_fire_safety_conform.nil?
  hash['isNoShow'] = @is_no_show unless @is_no_show.nil?
  hash['isPreferenceSmokingRoom'] = @is_preference_smoking_room unless @is_preference_smoking_room.nil?
  hash['numberOfAdults'] = @number_of_adults unless @number_of_adults.nil?
  hash['numberOfNights'] = @number_of_nights unless @number_of_nights.nil?
  hash['numberOfRooms'] = @number_of_rooms unless @number_of_rooms.nil?
  hash['programCode'] = @program_code unless @program_code.nil?
  hash['propertyCustomerServicePhoneNumber'] = @property_customer_service_phone_number unless @property_customer_service_phone_number.nil?
  hash['propertyPhoneNumber'] = @property_phone_number unless @property_phone_number.nil?
  hash['renterName'] = @renter_name unless @renter_name.nil?
  hash['rooms'] = @rooms.collect{|val| val.to_h} unless @rooms.nil?
  hash
end