Class: Blastramp::OrderBatch

Inherits:
Object
  • Object
show all
Defined in:
lib/blastramp/order_batch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(orders) ⇒ OrderBatch

Returns a new instance of OrderBatch.



6
7
8
# File 'lib/blastramp/order_batch.rb', line 6

def initialize(orders)
  @orders = orders
end

Instance Attribute Details

#ordersObject

Associations



4
5
6
# File 'lib/blastramp/order_batch.rb', line 4

def orders
  @orders
end

Instance Method Details

#soap_dataObject

Returns OrderedHash with the properties in the correct order, camelcased and ready to be sent via SOAP



12
13
14
15
16
17
18
19
# File 'lib/blastramp/order_batch.rb', line 12

def soap_data
  data = ActiveSupport::OrderedHash.new
  data[:order] = []
  orders.each do |o|
    data[:order] << o.soap_data
  end
  data
end