Class: RubyPython::PyEnumerable

Inherits:
RubyPyProxy show all
Includes:
Enumerable
Defined in:
lib/rubypython/rubypyproxy.rb

Overview

An object representing a Python enumerable object.

Instance Attribute Summary

Attributes inherited from RubyPyProxy

#pObject

Instance Method Summary collapse

Methods inherited from RubyPyProxy

#initialize, #inspect, #is_real_method?, #method_missing, #methods, #respond_to?, #rubify, #to_a, #to_enum, #to_s

Methods included from Operators

#<=>, #[], #[]=, bin_op, #include?, operator_, python_interpreter_update, rel_op, unary_op

Methods inherited from BlankObject

hide

Constructor Details

This class inherits a constructor from RubyPython::RubyPyProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RubyPython::RubyPyProxy

Instance Method Details

#eachObject



317
318
319
320
321
322
323
324
325
326
# File 'lib/rubypython/rubypyproxy.rb', line 317

def each
  iter = self.__iter__
  loop do
    begin
      yield iter.next
    rescue RubyPython::PythonError => exc
      return if exc.message =~ /StopIteration/
    end
  end
end