Class: QbIif::DSL::Trns

Inherits:
Base
  • Object
show all
Defined in:
lib/qb_iif/dsl/trns.rb

Constant Summary collapse

HEADER_COLUMNS =
[
  :trnsid,
  :trnstype,
  :date,
  :accnt,
  :name,
  :class,
  :amount,
  :docnum,
  :memo,
  :clear,
  :toprint,
  :addr1,
  :addr2,
  :addr3,
  :addr4,
  :addr5,
  :saddr1,
  :saddr2,
  :saddr3,
  :saddr4,
  :saddr5,
  :duedate,
  :terms,
  :paid,
  :paymeth,
  :shipdate,
  :rep,
  :ponum,
  :invtitle,
  :invmemo
]
START_COLUMN =
'TRNS'
END_COLUMN =
'ENDTRNS'

Constants included from Keywords

Keywords::ESCAPED_KEYWORDS

Instance Method Summary collapse

Methods inherited from Base

#build, #initialize, #method_missing, #output, #row

Methods included from Keywords

#escaped

Constructor Details

This class inherits a constructor from QbIif::DSL::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class QbIif::DSL::Base

Instance Method Details

#headersObject



38
39
40
41
42
43
44
# File 'lib/qb_iif/dsl/trns.rb', line 38

def headers
  [
    ["!#{START_COLUMN}"].concat(HEADER_COLUMNS.map(&:upcase)),
    ["!SPL"].concat(Spl::HEADER_COLUMNS.map(&:upcase)),
    ["!#{END_COLUMN}"]
  ]
end

#rowsObject



46
47
48
# File 'lib/qb_iif/dsl/trns.rb', line 46

def rows
  @rows << [END_COLUMN]
end

#spl(&block) ⇒ Object



50
51
52
53
54
# File 'lib/qb_iif/dsl/trns.rb', line 50

def spl(&block)
  Spl.new.build(&block)[:rows].each do |row|
    @rows << row
  end
end