Class: Record::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/records/record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, index, type) ⇒ Field

Returns a new instance of Field.



16
17
18
19
20
# File 'lib/records/record.rb', line 16

def initialize( key, index, type )
  @key    = key.to_sym  ## note: always symbol-ify (to_sym) key
  @index  = index
  @type   = type
end

Instance Attribute Details

#indexObject (readonly)

note: zero-based position index (0,1,2,3,…)



14
15
16
# File 'lib/records/record.rb', line 14

def index
  @index
end

#keyObject (readonly)

Returns the value of attribute key.



13
14
15
# File 'lib/records/record.rb', line 13

def key
  @key
end

#typeObject (readonly)

Returns the value of attribute type.



13
14
15
# File 'lib/records/record.rb', line 13

def type
  @type
end