Class: Enumex::Base
- Inherits:
-
Object
- Object
- Enumex::Base
- Defined in:
- lib/enumex/base.rb
Instance Attribute Summary collapse
-
#enumerator ⇒ Object
readonly
Returns the value of attribute enumerator.
Instance Method Summary collapse
Instance Attribute Details
#enumerator ⇒ Object (readonly)
Returns the value of attribute enumerator.
3 4 5 |
# File 'lib/enumex/base.rb', line 3 def enumerator @enumerator end |
Instance Method Details
#attach_to(enumerator, &block) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/enumex/base.rb', line 5 def attach_to(enumerator, &block) raise TypeError unless enumerator.is_a?(Enumerator) @enumerator = enumerator @block = block actions.empty? ? self : run end |