Class: Zuora::Calls::Generate

Inherits:
Hashie::Dash
  • Object
show all
Defined in:
lib/zuora/calls/generate.rb

Constant Summary collapse

OBJECT_TYPE =
:Invoice

Instance Method Summary collapse

Instance Method Details

#xml_builderCallable

Generates a function that takes a builder and updates object(s) of type.

Returns:

  • (Callable)
    • function of builder



11
12
13
14
15
16
17
18
19
# File 'lib/zuora/calls/generate.rb', line 11

def xml_builder
  fail 'objects must respond to :each' unless objects.respond_to?(:each)

  lambda do |builder|
    builder[:api].generate do
      Zuora::Utils::Envelope.build_objects builder, OBJECT_TYPE, objects
    end
  end
end