Class: Enumex::ActionContainers
- Inherits:
-
Object
- Object
- Enumex::ActionContainers
- Defined in:
- lib/enumex/action_containers.rb
Class Method Summary collapse
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(base) ⇒ ActionContainers
constructor
A new instance of ActionContainers.
- #reset ⇒ Object
Constructor Details
#initialize(base) ⇒ ActionContainers
Returns a new instance of ActionContainers.
9 10 11 |
# File 'lib/enumex/action_containers.rb', line 9 def initialize(base) @base = base end |
Class Method Details
.types ⇒ Object
4 5 6 |
# File 'lib/enumex/action_containers.rb', line 4 def types [:post, :pre] end |
Instance Method Details
#empty? ⇒ Boolean
27 28 29 |
# File 'lib/enumex/action_containers.rb', line 27 def empty? types.all? {|t| public_send(t).extenders.empty? } end |
#reset ⇒ Object
23 24 25 |
# File 'lib/enumex/action_containers.rb', line 23 def reset types.each {|nm| public_send(nm).extenders.each(&:reset) } end |