Class: Activecube::CubeDefinition::NamedHash
- Inherits:
-
Hash
- Object
- Hash
- Activecube::CubeDefinition::NamedHash
- Defined in:
- lib/activecube/cube_definition.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(cube, entry_class) ⇒ NamedHash
constructor
A new instance of NamedHash.
Constructor Details
#initialize(cube, entry_class) ⇒ NamedHash
Returns a new instance of NamedHash.
9 10 11 12 |
# File 'lib/activecube/cube_definition.rb', line 9 def initialize cube, entry_class @cube = cube @entry_class = entry_class end |
Instance Method Details
#[](key) ⇒ Object
14 15 16 17 |
# File 'lib/activecube/cube_definition.rb', line 14 def [] key v = super key v.nil? ? nil : @entry_class.new(@cube, key, v.new) end |