Sha256: 7ca7113d251d8de4b34a7865bf408aa9ac3a1590be89e0166447b96a6be546f3

Contents?: true

Size: 644 Bytes

Versions: 23

Compression:

Stored size: 644 Bytes

Contents

# encoding: utf-8
=begin
  Copyright(c) 2012 arton
=end

require 'rjb'

module Rjb
  JIterable = import('java.lang.Iterable')
  JIterator = import('java.util.Iterator')
  module Iterable
    def each
      it = iterator
      while it.has_next
        yield it.next
      end
    end
  end
  module Iterator
    def each
      while has_next
        yield self.next
      end
    end
  end
  class Rjb_JavaProxy
    def initialize_proxy
      if JIterable.isInstance(self)
        include Iterable
        include Enumerable
      elsif JIterator.isInstance(self)
        include Iterator
        include Enumerable
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rjb-1.7.3 lib/rjb/list.rb
rjb-1.7.1 lib/rjb/list.rb
rjb-1.7.0 lib/rjb/list.rb
rjb-1.6.9 lib/rjb/list.rb
rjb-1.6.8 lib/rjb/list.rb
rjb-1.6.7 lib/rjb/list.rb
rjb-1.6.6 lib/rjb/list.rb
rjb-1.6.5 lib/rjb/list.rb
rjb-1.6.4 lib/rjb/list.rb
rjb-1.6.3 lib/rjb/list.rb
rjb-1.6.2 lib/rjb/list.rb
rjb-1.6.1 lib/rjb/list.rb
rjb-1.6.0 lib/rjb/list.rb
rjb-1.5.9 lib/rjb/list.rb
rjb-1.5.8 lib/rjb/list.rb
rjb-1.5.7 lib/rjb/list.rb
rjb-1.5.6 lib/rjb/list.rb
rjb-1.5.5 lib/rjb/list.rb
rjb-1.5.4 lib/rjb/list.rb
rjb-1.5.3 lib/rjb/list.rb