Class: Quickeebooks::Windows::Service::TimeActivity
- Inherits:
-
ServiceBase
- Object
- ServiceBase
- Quickeebooks::Windows::Service::TimeActivity
- Defined in:
- lib/quickeebooks/windows/service/time_activity.rb
Constant Summary
Constants inherited from ServiceBase
Instance Attribute Summary
Attributes inherited from ServiceBase
#base_uri, #last_response_body, #last_response_xml, #oauth, #realm_id
Instance Method Summary collapse
- #create(time_activity) ⇒ Object
- #list(filters = [], page = 1, per_page = 20, sort = nil, options = {}) ⇒ Object
Methods inherited from ServiceBase
#access_token=, #enforce_filter_order, #initialize, #url_for_base, #url_for_resource
Methods included from Logging
Constructor Details
This class inherits a constructor from Quickeebooks::Windows::Service::ServiceBase
Instance Method Details
#create(time_activity) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/quickeebooks/windows/service/time_activity.rb', line 13 def create(time_activity) raise InvalidModelException unless time_activity.valid_for_create? # XML is a wrapped 'object' where the type is specified as an attribute # <Object xsi:type="Invoice"> xml_node = time_activity.to_xml(:name => 'Object') xml_node.set_attribute('xsi:type', 'TimeActivity') xml = Quickeebooks::Shared::Service::OperationNode.new.add do |content| content << "<ExternalRealmId>#{self.realm_id}</ExternalRealmId>#{xml_node}" end perform_write(Quickeebooks::Windows::Model::TimeActivity, xml) end |
#list(filters = [], page = 1, per_page = 20, sort = nil, options = {}) ⇒ Object
9 10 11 |
# File 'lib/quickeebooks/windows/service/time_activity.rb', line 9 def list(filters = [], page = 1, per_page = 20, sort = nil, = {}) fetch_collection(Quickeebooks::Windows::Model::TimeActivity, nil, filters, page, per_page, sort, ) end |