Class: Zuora::Calls::Upsert

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

Direct Known Subclasses

Create, Update

Instance Method Summary collapse

Instance Method Details

#call_nameObject



11
12
13
# File 'lib/zuora/calls/upsert.rb', line 11

def call_name
  fail 'This class is abstract. Subclassers must def :call_name'
end

#xml_builderCallable

Generates a function that takes a builder adds call of call_name and z-object(s) ogit rf type

Returns:

  • (Callable)
    • function of builder



18
19
20
21
22
23
24
25
26
# File 'lib/zuora/calls/upsert.rb', line 18

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

  lambda do |builder|
    builder[:api].send(call_name) do
      Zuora::Utils::Envelope.build_objects builder, type, objects
    end
  end
end