Class: OLE_QA::Framework::Account_Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/data_factory/account_factory.rb

Overview

Generate usable accounting strings from source files in ole-qa-framework/data/

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.account_matrixObject (readonly)

A Hash containing a list of valid OLE Test Environment Account Numbers. :Chart_Code => [[‘123456’,‘Account Name’],[‘789012’,‘Account Name’]]



32
33
34
# File 'lib/data_factory/account_factory.rb', line 32

def 
  @account_matrix
end

.object_matrixObject (readonly)

A Hash containing a list of valid OLE Test Environment Object Codes. :Chart_Code => [[],[]]



36
37
38
# File 'lib/data_factory/account_factory.rb', line 36

def object_matrix
  @object_matrix
end

Class Method Details

.select_account(chart_code = :BL) ⇒ Object

Return a random accounting array.

Parameters:

  • chart_code (Symbol) (defaults to: :BL)

    The chart code from which the account should be selected.



40
41
42
# File 'lib/data_factory/account_factory.rb', line 40

def (chart_code = :BL)
  @account_matrix[chart_code].sample
end

.select_object(chart_code = :BL) ⇒ Object

Return a random object array.

Parameters:

  • chart_code (Symbol) (defaults to: :BL)

    The chart code from which the object should be selected.



46
47
48
# File 'lib/data_factory/account_factory.rb', line 46

def select_object(chart_code = :BL)
  @object_matrix[chart_code].sample
end