Class: Record::Field
- Inherits:
-
Object
- Object
- Record::Field
- Defined in:
- lib/records/record.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
note: zero-based position index (0,1,2,3,…).
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(key, index, type) ⇒ Field
constructor
A new instance of Field.
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
#index ⇒ Object (readonly)
note: zero-based position index (0,1,2,3,…)
14 15 16 |
# File 'lib/records/record.rb', line 14 def index @index end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
13 14 15 |
# File 'lib/records/record.rb', line 13 def key @key end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
13 14 15 |
# File 'lib/records/record.rb', line 13 def type @type end |