Class: IntacctRuby::Functions::CreateItem

Inherits:
ItemBaseFunction show all
Defined in:
lib/intacct_ruby/functions/create_item.rb

Overview

creates an item instance in Intacct

Constant Summary

Constants inherited from ItemBaseFunction

ItemBaseFunction::ALL_PARAMS

Instance Method Summary collapse

Methods inherited from ItemBaseFunction

#item_params

Constructor Details

#initialize(attrs = {}) ⇒ CreateItem

Returns a new instance of CreateItem.



7
8
9
# File 'lib/intacct_ruby/functions/create_item.rb', line 7

def initialize(attrs = {})
  super "create_item_#{attrs[:itemid]}", attrs
end

Instance Method Details

#to_xmlObject



11
12
13
14
15
16
17
18
# File 'lib/intacct_ruby/functions/create_item.rb', line 11

def to_xml
  super do |xml|
    xml.create_item do
      xml.itemid @attrs[:itemid]
      xml << item_params
    end
  end
end