Class: HashWithSymbolAccess
- Inherits:
-
Hash
- Object
- Hash
- HashWithSymbolAccess
- Defined in:
- lib/rov/common.rb
Instance Method Summary collapse
Instance Method Details
#[](key) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/rov/common.rb', line 39 def [](key) if self.keys.include?(key) return super(key) elsif key.is_a?(Symbol) and self.keys.include?(key.to_s) return super(key.to_s) end end |
#[]=(key, value) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/rov/common.rb', line 47 def []=(key, value) if self.keys.include?(key) super(key, value) elsif key.is_a?(Symbol) and self.keys.include?(key.to_s) super(key.to_s, value) end end |