Module: Hanami::Action::Exposable::ClassMethods Private
- Defined in:
- lib/hanami/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
(also: #_expose)
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 Also known as: _expose
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.
65 66 67 68 69 70 71 72 73 |
# File 'lib/hanami/action/exposable.rb', line 65 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
85 86 87 |
# File 'lib/hanami/action/exposable.rb', line 85 def exposures @exposures ||= [] end |