Class: MethodedHash
- Inherits:
-
Hash
- Object
- Hash
- MethodedHash
- Defined in:
- lib/ruby/extensions/methoded_hash.rb
Class Method Summary collapse
-
.create(h = {}) ⇒ Object
create(h = {}).
Instance Method Summary collapse
- #[]=(key, value) ⇒ Object
-
#initialize(h = {}) ⇒ MethodedHash
constructor
A new instance of MethodedHash.
Constructor Details
#initialize(h = {}) ⇒ MethodedHash
Returns a new instance of MethodedHash.
3 4 5 6 |
# File 'lib/ruby/extensions/methoded_hash.rb', line 3 def initialize(h = {}) duplicate_hash(h) self end |
Class Method Details
.create(h = {}) ⇒ Object
create(h = {})
create
force-creates a MethodedHash class, avoiding potential conflicts with children classes. However it can be overridden by children classes if needed.
55 56 57 |
# File 'lib/ruby/extensions/methoded_hash.rb', line 55 def create(h = {}) MethodedHash.new(h) end |
Instance Method Details
#[]=(key, value) ⇒ Object
8 9 10 11 |
# File 'lib/ruby/extensions/methoded_hash.rb', line 8 def []=(key, value) common_methodizer(key) super end |