Module: Refried::Getter::ClassMethods
- Defined in:
- lib/refried/getter.rb
Constant Summary collapse
- SUPPORTED_MODES =
[:tube_name]
Instance Method Summary collapse
-
#getter_mode ⇒ Symbol
Get the current mapping mode of the Getter.
-
#getter_mode=(mode) ⇒ Object
(also: #get_mode)
Set the mode of function that the Getter should follow.
Instance Method Details
#getter_mode ⇒ Symbol
Get the current mapping mode of the Getter
27 28 29 |
# File 'lib/refried/getter.rb', line 27 def getter_mode @getter_mode ||= :tube_name end |
#getter_mode=(mode) ⇒ Object Also known as: get_mode
Set the mode of function that the Getter should follow
17 18 19 20 21 22 |
# File 'lib/refried/getter.rb', line 17 def getter_mode=(mode) unless SUPPORTED_MODES.include? mode raise ArgumentError, "Unsupported mode for acts_as_getter." end @getter_mode = mode end |