Class: Dhl::Intraship::BookingInformation
- Inherits:
-
Object
- Object
- Dhl::Intraship::BookingInformation
- Defined in:
- lib/dhl-intraship/booking_information.rb
Constant Summary collapse
- VALID_PRODUCT_IDS =
[:TDI, :TDN, :DDI, :DDN]
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#amount_of_pallets ⇒ Object
Returns the value of attribute amount_of_pallets.
-
#amount_of_pieces ⇒ Object
Returns the value of attribute amount_of_pieces.
-
#attendance ⇒ Object
Returns the value of attribute attendance.
-
#closing_time ⇒ Object
Returns the value of attribute closing_time.
-
#count_of_shipments ⇒ Object
Returns the value of attribute count_of_shipments.
-
#max_height_in_cm ⇒ Object
Returns the value of attribute max_height_in_cm.
-
#max_length_in_cm ⇒ Object
Returns the value of attribute max_length_in_cm.
-
#max_width_in_cm ⇒ Object
Returns the value of attribute max_width_in_cm.
-
#pickup_date ⇒ Object
Returns the value of attribute pickup_date.
-
#pickup_location ⇒ Object
Returns the value of attribute pickup_location.
-
#product_id ⇒ Object
Returns the value of attribute product_id.
-
#ready_by_time ⇒ Object
Returns the value of attribute ready_by_time.
-
#remark ⇒ Object
Returns the value of attribute remark.
-
#total_volume_weight ⇒ Object
Returns the value of attribute total_volume_weight.
-
#weight_in_kg ⇒ Object
Returns the value of attribute weight_in_kg.
Instance Method Summary collapse
- #append_to_xml(xml) ⇒ Object
-
#initialize(attributes = {}) ⇒ BookingInformation
constructor
A new instance of BookingInformation.
Constructor Details
#initialize(attributes = {}) ⇒ BookingInformation
Returns a new instance of BookingInformation.
9 10 11 12 13 14 15 16 17 |
# File 'lib/dhl-intraship/booking_information.rb', line 9 def initialize(attributes = {}) self.product_id = :DDN attributes.each do |key, value| setter = :"#{key.to_s}=" if self.respond_to?(setter) self.send(setter, value) end end end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def account @account end |
#amount_of_pallets ⇒ Object
Returns the value of attribute amount_of_pallets.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def amount_of_pallets @amount_of_pallets end |
#amount_of_pieces ⇒ Object
Returns the value of attribute amount_of_pieces.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def amount_of_pieces @amount_of_pieces end |
#attendance ⇒ Object
Returns the value of attribute attendance.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def attendance @attendance end |
#closing_time ⇒ Object
Returns the value of attribute closing_time.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def closing_time @closing_time end |
#count_of_shipments ⇒ Object
Returns the value of attribute count_of_shipments.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def count_of_shipments @count_of_shipments end |
#max_height_in_cm ⇒ Object
Returns the value of attribute max_height_in_cm.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def max_height_in_cm @max_height_in_cm end |
#max_length_in_cm ⇒ Object
Returns the value of attribute max_length_in_cm.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def max_length_in_cm @max_length_in_cm end |
#max_width_in_cm ⇒ Object
Returns the value of attribute max_width_in_cm.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def max_width_in_cm @max_width_in_cm end |
#pickup_date ⇒ Object
Returns the value of attribute pickup_date.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def pickup_date @pickup_date end |
#pickup_location ⇒ Object
Returns the value of attribute pickup_location.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def pickup_location @pickup_location end |
#product_id ⇒ Object
Returns the value of attribute product_id.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def product_id @product_id end |
#ready_by_time ⇒ Object
Returns the value of attribute ready_by_time.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def ready_by_time @ready_by_time end |
#remark ⇒ Object
Returns the value of attribute remark.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def remark @remark end |
#total_volume_weight ⇒ Object
Returns the value of attribute total_volume_weight.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def total_volume_weight @total_volume_weight end |
#weight_in_kg ⇒ Object
Returns the value of attribute weight_in_kg.
4 5 6 |
# File 'lib/dhl-intraship/booking_information.rb', line 4 def weight_in_kg @weight_in_kg end |
Instance Method Details
#append_to_xml(xml) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/dhl-intraship/booking_information.rb', line 24 def append_to_xml(xml) product_id = @product_id xml.BookingInformation do |xml| xml.ProductID(product_id) xml.Account(account) xml.Attendance(attendance) if attendance xml.PickupDate(pickup_date) xml.ReadyByTime(ready_by_time) xml.ClosingTime(closing_time) xml.PickupLocation(pickup_location) if pickup_location xml.AmountOfPieces(amount_of_pieces) if amount_of_pieces xml.AmountOfPallets(amount_of_pallets) if amount_of_pallets xml.WeightInKG(weight_in_kg) if weight_in_kg xml.CountOfShipments(count_of_shipments) if count_of_shipments xml.TotalVolumeWeight(total_volume_weight) if total_volume_weight xml.MaxLengthInCM(max_height_in_cm) if max_length_in_cm xml.MaxWidthInCM(max_width_in_cm) if max_width_in_cm xml.MaxHeightInCM(max_height_in_cm) if max_length_in_cm end end |