Class: Quickbooks::Model::BatchRequest
- Defined in:
- lib/quickbooks/model/batch_request.rb
Defined Under Namespace
Classes: BatchItemRequest
Constant Summary collapse
- XML_COLLECTION_NODE =
"IntuitBatchRequest"
- XML_NODE =
"IntuitBatchRequest"
- REST_RESOURCE =
'batch'
Instance Method Summary collapse
- #add(batch_item_id, batch_item, operation) ⇒ Object
-
#initialize ⇒ BatchRequest
constructor
A new instance of BatchRequest.
Methods inherited from BaseModel
#as_json, attribute_names, #attributes, attrs_with_types, #inspect, inspect, reference_attrs, reference_setters, resource_for_collection, resource_for_singular, to_xml_big_decimal, #to_xml_inject_ns, #to_xml_ns
Methods included from Validator
Methods included from Definition
included, #is_name_list_entity?, #is_transaction_entity?
Constructor Details
#initialize ⇒ BatchRequest
Returns a new instance of BatchRequest.
34 35 36 |
# File 'lib/quickbooks/model/batch_request.rb', line 34 def initialize self.request_items = [] end |
Instance Method Details
#add(batch_item_id, batch_item, operation) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/quickbooks/model/batch_request.rb', line 38 def add(batch_item_id, batch_item, operation) bir = Quickbooks::Model::BatchRequest::BatchItemRequest.new bir.operation = operation bir.bId = batch_item_id bir.send("#{batch_item.class::XML_NODE.underscore}=", batch_item) self.request_items << bir end |