Sha256: 1567a76113127c9c5ad94e16acd7faa5f8306f97e664b817b0a609cd5ea84db2

Contents?: true

Size: 262 Bytes

Versions: 3

Compression:

Stored size: 262 Bytes

Contents

module Enumerable
  # Fixnum()
  #
  # Return the number of elements of the Enumerable. Same as _size_ but not all
  # Enumerables implement size.
  #--
  # Should we call the methods _size_?
  def length
    inject(0) do |sum,v|
      sum + 1
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rgl-0.3.1 lib/rgl/enumerable_ext.rb
rgl-0.4.0 lib/rgl/enumerable_ext.rb
rgl-0.3.0 lib/rgl/enumerable_ext.rb