Class: HostConnect::PaxDetailsBuilder
- Inherits:
-
AbstractBuilder
- Object
- AbstractBuilder
- HostConnect::PaxDetailsBuilder
- Defined in:
- lib/hostconnect/builders/pax_details_builder.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ PaxDetailsBuilder
constructor
A new instance of PaxDetailsBuilder.
- #to_xml ⇒ Object
Methods inherited from AbstractBuilder
Constructor Details
#initialize(options = {}) ⇒ PaxDetailsBuilder
Returns a new instance of PaxDetailsBuilder.
3 4 5 6 7 8 |
# File 'lib/hostconnect/builders/pax_details_builder.rb', line 3 def initialize( = {}) @valid_options = [ :title, :forename, :surname, :date_of_birth, :pax_type, :pax_text1, :pax_text2, :pax_text3, :pax_text4, :pax_text5 ].freeze super() end |
Instance Method Details
#to_xml ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/hostconnect/builders/pax_details_builder.rb', line 10 def to_xml x = Builder::XmlMarkup.new(:indent => 2, :margin => 5) x.PaxDetails { @valid_options.each do |opt| val = eval "#{opt}" eval "x.#{opt.camelize} #{opt}" unless val.blank? end } x end |