netsuite 0.0.41 → 0.0.42
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
|
-
|
10
|
+
initialize_from_attributes_hash(attributes)
|
11
|
+
end
|
12
|
+
|
13
|
+
def line=(lines)
|
14
|
+
case lines
|
9
15
|
when Hash
|
10
|
-
lines << JournalEntryLine.new(
|
16
|
+
self.lines << JournalEntryLine.new(lines)
|
11
17
|
when Array
|
12
|
-
|
18
|
+
lines.each { |line| self.lines << JournalEntryLine.new(line) }
|
13
19
|
end
|
14
20
|
end
|
15
21
|
|
16
22
|
def lines
|
17
|
-
@
|
23
|
+
@items ||= []
|
18
24
|
end
|
19
25
|
|
20
26
|
def to_record
|
21
|
-
lines.map
|
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
|
data/lib/netsuite/version.rb
CHANGED
@@ -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:
|
4
|
+
hash: 75
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 42
|
10
|
+
version: 0.0.42
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Moran
|