netsuite 0.0.41 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,24 +3,28 @@ module NetSuite
3
3
  class JournalEntryLineList
4
4
  include Support::Fields
5
5
  include Namespaces::TranGeneral
6
+
7
+ fields :line
6
8
 
7
9
  def initialize(attributes = {})
8
- case attributes[:line]
10
+ initialize_from_attributes_hash(attributes)
11
+ end
12
+
13
+ def line=(lines)
14
+ case lines
9
15
  when Hash
10
- lines << JournalEntryLine.new(attributes[:line])
16
+ self.lines << JournalEntryLine.new(lines)
11
17
  when Array
12
- attributes[:line].each { |line| lines << JournalEntryLine.new(line) }
18
+ lines.each { |line| self.lines << JournalEntryLine.new(line) }
13
19
  end
14
20
  end
15
21
 
16
22
  def lines
17
- @lines ||= []
23
+ @items ||= []
18
24
  end
19
25
 
20
26
  def to_record
21
- lines.map do |line|
22
- { "#{record_namespace}:line" => line.to_record }
23
- end
27
+ { "#{record_namespace}:line" => lines.map(&:to_record) }
24
28
  end
25
29
 
26
30
  end
@@ -1,3 +1,3 @@
1
1
  module Netsuite
2
- VERSION = '0.0.41'
2
+ VERSION = '0.0.42'
3
3
  end
@@ -13,13 +13,12 @@ describe NetSuite::Records::JournalEntryLineList do
13
13
  end
14
14
 
15
15
  it 'can represent itself as a SOAP record' do
16
- record = [
16
+ record =
17
17
  {
18
- 'tranGeneral:line' => {
18
+ 'tranGeneral:line' => [{
19
19
  'tranGeneral:memo' => 'This is a memo'
20
- }
20
+ }]
21
21
  }
22
- ]
23
22
  list.to_record.should eql(record)
24
23
  end
25
24
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netsuite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 77
4
+ hash: 75
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 41
10
- version: 0.0.41
9
+ - 42
10
+ version: 0.0.42
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Moran