Module: ActivePStore::AttributeMethods
- Included in:
- Base
- Defined in:
- lib/active_pstore/attribute_methods.rb
Instance Method Summary collapse
Instance Method Details
#[](attr) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/active_pstore/attribute_methods.rb', line 3 def [](attr) if respond_to? attr.to_sym self.__send__(attr.to_sym) else raise "undefined method `#{attr}'" end end |
#[]=(attr, value) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/active_pstore/attribute_methods.rb', line 11 def []=(attr, value) if respond_to? "#{attr}=".to_sym self.__send__("#{attr}=".to_sym, value) else raise "undefined method `#{attr}='" end end |