Class: IntacctRuby::Functions::BaseFunction
- Inherits:
-
Object
- Object
- IntacctRuby::Functions::BaseFunction
- Defined in:
- lib/intacct_ruby/functions/base_function.rb
Overview
Creates the basic structure for all functions. Meant to be an interface: this should not be implemented on its own.
Direct Known Subclasses
CreateARAdjustment, CustomerBaseFunction, EmployeeBaseFunction, ItemBaseFunction, LocationBaseFunction, ProjectBaseFunction
Instance Method Summary collapse
-
#initialize(controlid, attrs = {}) ⇒ BaseFunction
constructor
A new instance of BaseFunction.
- #to_xml ⇒ Object
Constructor Details
#initialize(controlid, attrs = {}) ⇒ BaseFunction
Returns a new instance of BaseFunction.
8 9 10 11 12 13 |
# File 'lib/intacct_ruby/functions/base_function.rb', line 8 def initialize(controlid, attrs = {}) @controlid = controlid @attrs = attrs @xml = Builder::XmlMarkup.new end |
Instance Method Details
#to_xml ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/intacct_ruby/functions/base_function.rb', line 15 def to_xml @xml.function controlid: @controlid do yield(@xml) end # converts xml to string @xml.target! end |