Class: NetSuite::Records::CustomRecord

Inherits:
Object
  • Object
show all
Includes:
Namespaces::SetupCustom, Support::Actions, Support::Fields, Support::RecordRefs, Support::Records
Defined in:
lib/netsuite/records/custom_record.rb

Instance Attribute Summary collapse

Attributes included from Support::Actions

#errors

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Namespaces::SetupCustom

#record_namespace

Methods included from Support::Actions

included

Methods included from Support::Records

#netsuite_type, netsuite_type, record_type_without_namespace, #record_type_without_namespace, #refresh, #to_attributes!, #to_record

Methods included from Namespaces::PlatformCore

#record_namespace

Methods included from Support::Attributes

#attributes, #attributes=, #initialize_from_attributes_hash

Methods included from Support::RecordRefs

included

Methods included from Support::Fields

included

Constructor Details

#initialize(attributes = {}) ⇒ CustomRecord

Returns a new instance of CustomRecord.



27
28
29
30
31
# File 'lib/netsuite/records/custom_record.rb', line 27

def initialize(attributes = {})
  @internal_id = attributes.delete(:internal_id) || attributes.delete(:@internal_id)
  @external_id = attributes.delete(:external_id) || attributes.delete(:@external_id)
  initialize_from_attributes_hash(attributes)
end

Instance Attribute Details

#external_idObject

Returns the value of attribute external_id.



25
26
27
# File 'lib/netsuite/records/custom_record.rb', line 25

def external_id
  @external_id
end

#internal_idObject (readonly)

Returns the value of attribute internal_id.



24
25
26
# File 'lib/netsuite/records/custom_record.rb', line 24

def internal_id
  @internal_id
end

Class Method Details

.get(options = {}) ⇒ Object



33
34
35
36
# File 'lib/netsuite/records/custom_record.rb', line 33

def self.get(options = {})
  options.merge!(:type_id => type_id) unless options[:type_id]
  super(options.merge(:custom => true))
end

.type_id(id = nil) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/netsuite/records/custom_record.rb', line 42

def self.type_id(id = nil)
  if id
    @type_id = id
  end

  @type_id
end

Instance Method Details

#deleteObject



38
39
40
# File 'lib/netsuite/records/custom_record.rb', line 38

def delete
  super(:custom => true)
end

#record_typeObject



50
51
52
# File 'lib/netsuite/records/custom_record.rb', line 50

def record_type
  "#{record_namespace}:CustomRecord"
end