Class: NetSuite::Records::RecordRefList
Instance Method Summary
collapse
#record_namespace
#record_type, #to_attributes!
#attributes, #attributes=, #initialize_from_attributes_hash
included
Constructor Details
Returns a new instance of RecordRefList.
10
11
12
|
# File 'lib/netsuite/records/record_ref_list.rb', line 10
def initialize(attrs = {})
initialize_from_attributes_hash(attrs)
end
|
Instance Method Details
#record_ref ⇒ Object
23
24
25
|
# File 'lib/netsuite/records/record_ref_list.rb', line 23
def record_ref
@record_ref ||= []
end
|
#record_ref=(items) ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/netsuite/records/record_ref_list.rb', line 14
def record_ref=(items)
case items
when Hash
self.record_ref << RecordRef.new(items)
when Array
items.each { |ref| self.record_ref << RecordRef.new(ref) }
end
end
|
#to_record ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/netsuite/records/record_ref_list.rb', line 27
def to_record
{
"#{record_namespace}:recordRef" => record_ref.map do |rr|
rec = rr.to_record
rec[:@internalId] = rr.internal_id if rr.internal_id
rec[:@externalId] = rr.external_id if rr.external_id
rec[:@type] = rr.type if rr.type
rec
end
}
end
|