class Quickeebooks::Online::Model::IntuitType

Public Class Methods

resource_for_collection() click to toggle source

These can be over-ridden in each model object as needed For the most part a model object has a single resource for all operations E.g. <baseURL>/resource/invoice/v2/<realmID> But for the Account object its collection is plural while all other operations are singular E.g. Fetch all accounts: <baseURL>/resource/accounts/v2/<realmID>

vs

Create an account, fetch an account, etc: <baseURL>/resource/account/v2/<realmID>

# File lib/quickeebooks/online/model/intuit_type.rb, line 17
def self.resource_for_collection
  "#{self::REST_RESOURCE}s"
end
resource_for_singular() click to toggle source
# File lib/quickeebooks/online/model/intuit_type.rb, line 21
def self.resource_for_singular
  self::REST_RESOURCE
end

Private Instance Methods

to_xml_inject_ns(model_name, options = {}) click to toggle source

ROXML doesnt insert the namespaces into generated XML so we need to do it ourselves insert the static namespaces in the first opening tag that matches the model_name

# File lib/quickeebooks/online/model/intuit_type.rb, line 30
def to_xml_inject_ns(model_name, options = {})
  s = StringIO.new
  xml = to_xml(options).write_to(s, :indent => 0, :indent_text => '')
  destination_name = options.fetch(:destination_name, nil)
  destination_name ||= model_name

  step1 = s.string.sub("<#{model_name}>", "<#{destination_name} #{Quickeebooks::Online::Service::ServiceBase::XML_NS}>")
  step2 = step1.sub("</#{model_name}>", "</#{destination_name}>")
  step2
end