Method: Inch::Utils::ReadWriteMethods#rw_method
- Defined in:
- lib/inch/utils/read_write_methods.rb
#rw_method(name) ⇒ void
This method returns an undefined value.
Implements a read method that acts as writer if called with a value
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/inch/utils/read_write_methods.rb', line 23 def rw_method(name) class_eval """ def #{name}(value = nil) if value.nil? @#{name} else @#{name} = value end end """ end |