Class: Oca::Epak::PickupData

Inherits:
Object
  • Object
show all
Defined in:
lib/oca-epak/pickup_data.rb

Constant Summary collapse

PATH_TO_XML =
File.expand_path("../retiro.xml.erb", __FILE__).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ PickupData

Creates a Pickup Data object for creating a pickup order in OCA.

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :account_number (String)

    Account Number (SAP)

  • :pickup (Hash)

    Pickup Hash

  • :shipments (Array<Hash>)

    Shipments Hash



14
15
16
17
18
# File 'lib/oca-epak/pickup_data.rb', line 14

def initialize(opts = {})
  self. = opts[:account_number]
  self.pickup = opts[:pickup]
  self.shipments = opts[:shipments]
end

Instance Attribute Details

#account_numberObject

Returns the value of attribute account_number.



6
7
8
# File 'lib/oca-epak/pickup_data.rb', line 6

def 
  @account_number
end

#pickupObject

Returns the value of attribute pickup.



6
7
8
# File 'lib/oca-epak/pickup_data.rb', line 6

def pickup
  @pickup
end

#shipmentsObject

Returns the value of attribute shipments.



6
7
8
# File 'lib/oca-epak/pickup_data.rb', line 6

def shipments
  @shipments
end

Instance Method Details

#to_xmlObject



20
21
22
# File 'lib/oca-epak/pickup_data.rb', line 20

def to_xml
  or_template.result(binding)
end