Class: Heft::DataItem

Inherits:
Object
  • Object
show all
Defined in:
lib/heft/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



12
13
14
# File 'lib/heft/data.rb', line 12

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



12
13
14
# File 'lib/heft/data.rb', line 12

def value
  @value
end