Module: Mwc::Utils::HashAccessor
- Defined in:
- lib/mwc/utils/hash_accessor.rb
Overview
Provide Hash-like accessor
Instance Method Summary collapse
-
#[](name) ⇒ Object
private
Hash-like getter.
-
#[]=(name, value) ⇒ Object
private
Hash-like setter.
Instance Method Details
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Hash-like getter
13 14 15 16 17 |
# File 'lib/mwc/utils/hash_accessor.rb', line 13 def [](name) return unless respond_to?(name) send(name) end |
#[]=(name, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Hash-like setter
26 27 28 29 30 |
# File 'lib/mwc/utils/hash_accessor.rb', line 26 def []=(name, value) return unless respond_to?("#{name}=") send("#{name}=", value) end |