Class: Heft::DataItem
- Inherits:
-
Object
- Object
- Heft::DataItem
- Defined in:
- lib/heft/data.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ DataItem
constructor
A new instance of DataItem.
Constructor Details
#initialize(opts = {}) ⇒ DataItem
Returns a new instance of DataItem.
14 15 16 17 |
# File 'lib/heft/data.rb', line 14 def initialize(opts={}) @key = opts[:key] || fail("You must supply :key") @value = opts[:value] || fail("You must supply :value") end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
12 13 14 |
# File 'lib/heft/data.rb', line 12 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
12 13 14 |
# File 'lib/heft/data.rb', line 12 def value @value end |