Module: Lotus::Action::Exposable::ClassMethods Private
- Defined in:
- lib/lotus/action/exposable.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Exposures API class methods
Instance Method Summary collapse
-
#expose(*names) ⇒ void
private
Expose the given attributes on the outside of the object with a getter and a special method called #exposures.
-
#exposures ⇒ Array
private
Set of exposures attribute names.
Instance Method Details
#expose(*names) ⇒ void
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.
This method returns an undefined value.
Expose the given attributes on the outside of the object with a getter and a special method called #exposures.
58 59 60 61 62 63 64 65 66 |
# File 'lib/lotus/action/exposable.rb', line 58 def expose(*names) class_eval do names.each do |name| attr_reader(name) unless attr_reader?(name) end exposures.push(*names) end end |
#exposures ⇒ Array
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.
Set of exposures attribute names
74 75 76 |
# File 'lib/lotus/action/exposable.rb', line 74 def exposures @exposures ||= [] end |