Class: Dhl::Intraship::BookingInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/dhl-intraship/booking_information.rb

Constant Summary collapse

VALID_PRODUCT_IDS =
[:TDI, :TDN, :DDI, :DDN]

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#accountObject

Returns the value of attribute account.



4
5
6
# File 'lib/dhl-intraship/booking_information.rb', line 4

def 
  @account
end

#amount_of_palletsObject

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_piecesObject

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

#attendanceObject

Returns the value of attribute attendance.



4
5
6
# File 'lib/dhl-intraship/booking_information.rb', line 4

def attendance
  @attendance
end

#closing_timeObject

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_shipmentsObject

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_cmObject

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_cmObject

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_cmObject

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_dateObject

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_locationObject

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_idObject

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_timeObject

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

#remarkObject

Returns the value of attribute remark.



4
5
6
# File 'lib/dhl-intraship/booking_information.rb', line 4

def remark
  @remark
end

#total_volume_weightObject

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_kgObject

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()
    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