Class: Iloxx::Shipping::Parcel
- Inherits:
-
Object
- Object
- Iloxx::Shipping::Parcel
- Defined in:
- lib/iloxx_shipping/parcel.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#content ⇒ Object
Returns the value of attribute content.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#internal_reference ⇒ Object
Returns the value of attribute internal_reference.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#service ⇒ Object
Returns the value of attribute service.
-
#track_url ⇒ Object
Returns the value of attribute track_url.
-
#weight ⇒ Object
Returns the value of attribute weight.
Instance Method Summary collapse
- #append_to_xml(xml) ⇒ Object
-
#initialize(attributes = {}) ⇒ Parcel
constructor
A new instance of Parcel.
Constructor Details
#initialize(attributes = {}) ⇒ Parcel
Returns a new instance of Parcel.
6 7 8 9 10 11 12 13 |
# File 'lib/iloxx_shipping/parcel.rb', line 6 def initialize(attributes = {}) attributes.each do |key, value| setter = :"#{key.to_s}=" if self.respond_to?(setter) self.send(setter, value) end end end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def address @address end |
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def content @content end |
#customer ⇒ Object
Returns the value of attribute customer.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def customer @customer end |
#internal_reference ⇒ Object
Returns the value of attribute internal_reference.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def internal_reference @internal_reference end |
#reference ⇒ Object
Returns the value of attribute reference.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def reference @reference end |
#service ⇒ Object
Returns the value of attribute service.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def service @service end |
#track_url ⇒ Object
Returns the value of attribute track_url.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def track_url @track_url end |
#weight ⇒ Object
Returns the value of attribute weight.
4 5 6 |
# File 'lib/iloxx_shipping/parcel.rb', line 4 def weight @weight end |
Instance Method Details
#append_to_xml(xml) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/iloxx_shipping/parcel.rb', line 15 def append_to_xml(xml) xml.tns(:ppvOrderData) do |xml| xml.tns(:PartnerOrderReference, internal_reference || " ") xml.tns(:Customer, customer || " ") xml.tns(:Reference, reference || " ") xml.tns(:Content, content) xml.tns(:Weight, weight) xml.tns(:ShipService, service.service_type) xml.tns(:CODAmount, service.cod_amount || 0) address.append_to_xml(xml) xml.tns(:TrackURL, track_url || "") end end |