Class: Ru::Iterator
- Inherits:
-
Object
- Object
- Ru::Iterator
- Defined in:
- lib/ru/iterator.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(array) ⇒ Iterator
constructor
A new instance of Iterator.
- #to_a ⇒ Object
- #to_stdout ⇒ Object
Constructor Details
#initialize(array) ⇒ Iterator
Returns a new instance of Iterator.
15 16 17 |
# File 'lib/ru/iterator.rb', line 15 def initialize(array) @array = array end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
29 30 31 |
# File 'lib/ru/iterator.rb', line 29 def method_missing(method, *args, &block) map_method(method, *args, &block) end |
Class Method Details
.redefined_methods ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/ru/iterator.rb', line 4 def redefined_methods @redefined_methods ||= begin preserved_methods = %{initialize method_missing respond_to? to_a} [].public_methods.select do |method| method = method.to_s method =~ /^[a-z]/ && !preserved_methods.include?(method) end end end |