Class: LedgerSync::Adaptors::NetSuite::Record::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/ledger_sync/adaptors/netsuite/record/property.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enum: [], format: nil, key:, title:, type:) ⇒ Property

Returns a new instance of Property.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ledger_sync/adaptors/netsuite/record/property.rb', line 17

def initialize(
  enum: [],
  format: nil,
  key:,
  title:,
  type:
)

  @enum = enum
  @format = format
  @key = key
  @title = title
  @type = type
end

Instance Attribute Details

#enumObject (readonly)

Returns the value of attribute enum.



11
12
13
# File 'lib/ledger_sync/adaptors/netsuite/record/property.rb', line 11

def enum
  @enum
end

#formatObject (readonly)

Returns the value of attribute format.



11
12
13
# File 'lib/ledger_sync/adaptors/netsuite/record/property.rb', line 11

def format
  @format
end

#keyObject (readonly)

Returns the value of attribute key.



11
12
13
# File 'lib/ledger_sync/adaptors/netsuite/record/property.rb', line 11

def key
  @key
end

#titleObject (readonly)

Returns the value of attribute title.



11
12
13
# File 'lib/ledger_sync/adaptors/netsuite/record/property.rb', line 11

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/ledger_sync/adaptors/netsuite/record/property.rb', line 11

def type
  @type
end

Class Method Details

.new_from_hash(data:, key:) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/ledger_sync/adaptors/netsuite/record/property.rb', line 32

def self.new_from_hash(data:, key:)
  new(
    enum: data['enum'],
    format: data['format'],
    key: key,
    title: data['title'],
    type: data['type']
  )
end