Class: NetSuite::Records::JournalEntryLineList

Inherits:
Object
  • Object
show all
Includes:
Namespaces::TranGeneral, Support::Fields
Defined in:
lib/netsuite/records/journal_entry_line_list.rb

Instance Method Summary collapse

Methods included from Namespaces::TranGeneral

#record_namespace

Methods included from Support::Fields

included

Methods included from Support::Attributes

#attributes, #attributes=, #initialize_from_attributes_hash

Constructor Details

#initialize(attributes = {}) ⇒ JournalEntryLineList

Returns a new instance of JournalEntryLineList.



9
10
11
# File 'lib/netsuite/records/journal_entry_line_list.rb', line 9

def initialize(attributes = {})
  initialize_from_attributes_hash(attributes)
end

Instance Method Details

#line=(lines) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/netsuite/records/journal_entry_line_list.rb', line 13

def line=(lines)
  case lines
  when Hash
    self.lines << JournalEntryLine.new(lines)
  when Array
    lines.each { |line| self.lines << JournalEntryLine.new(line) }
  end
end

#linesObject



22
23
24
# File 'lib/netsuite/records/journal_entry_line_list.rb', line 22

def lines
  @items ||= []
end

#to_recordObject



26
27
28
# File 'lib/netsuite/records/journal_entry_line_list.rb', line 26

def to_record
  { "#{record_namespace}:line" => lines.map(&:to_record) }
end