Class: HostConnect::RoomConfigBuilder
- Inherits:
-
AbstractBuilder
- Object
- AbstractBuilder
- HostConnect::RoomConfigBuilder
- Defined in:
- lib/hostconnect/builders/room_config_builder.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RoomConfigBuilder
constructor
Room types: SG (single), TW (twin), DB (double), TR (triple), QD (quad).
- #to_xml ⇒ Object
Methods inherited from AbstractBuilder
Constructor Details
#initialize(options = {}) ⇒ RoomConfigBuilder
Room types: SG (single), TW (twin), DB (double), TR (triple), QD (quad)
4 5 6 7 |
# File 'lib/hostconnect/builders/room_config_builder.rb', line 4 def initialize( = {}) @valid_options = [ :adults, :room_type, :pax_list ].freeze super() end |
Instance Method Details
#to_xml ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/hostconnect/builders/room_config_builder.rb', line 9 def to_xml x = Builder::XmlMarkup.new(:indent => 2, :margin => 3) x.RoomConfig { x.Adults @adults if @adults x.RoomType @room_type if @room_type if @pax_list # Stack the PaxDetails builder objects onto the request x.PaxList { |i| @pax_list.each { |pax| i << pax.to_xml.target! } } end } x end |