Class: OLE_QA::Framework::OLEFS::Invoice_Line_Object

Inherits:
Common_Object
  • Object
show all
Defined in:
lib/olefs/common/invoice_line_object.rb

Overview

This object is an inheritable base class for all line-type objects on an OLE Financial System Invoice.

  • This class provides a different mechanism for line_id and makes line_number an accessor attribute, allowing for dynamic redefinition of line object elements and sub-elements.

  • Instead of instantiating a new line object for each line and subline, the line_number can be updated in each line and subline object. This allows for slightly deeper recursion without the need of introducing a new level of sub-object below the subline object.

Instance Attribute Summary collapse

Attributes inherited from Common_Object

#elements, #functions, #ole

Instance Method Summary collapse

Methods inherited from Common_Object

#set_elements, #set_functions

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

#initialize(ole_session, line_number = 1) ⇒ Invoice_Line_Object

Returns a new instance of Invoice_Line_Object.



27
28
29
30
# File 'lib/olefs/common/invoice_line_object.rb', line 27

def initialize(ole_session, line_number = 1)
  @line_number = line_number
  super(ole_session)
end

Instance Attribute Details

#line_numberObject

Allow the line_number attribute to be updated for dynamic element definitions.



25
26
27
# File 'lib/olefs/common/invoice_line_object.rb', line 25

def line_number
  @line_number
end

Instance Method Details

#line_idObject

A reader method for the line_id function.



33
34
35
# File 'lib/olefs/common/invoice_line_object.rb', line 33

def line_id
  @line_number - 1
end