Sha256: 2464140e0cc17317814ce168c4af327f255585f4e165b4b77cfca174a7a00bfe

Contents?: true

Size: 303 Bytes

Versions: 17

Compression:

Stored size: 303 Bytes

Contents

class Integer

  # Like #times but returns a collection of the yield results.
  #
  #   a = 3.of { |i| "#{i+1}" }
  #   a => [ "1", "2", "3" ]
  #

  def of(&block)
    Array.new(self, &block)
  end

  # Time warn aliases for #of.
  alias_method :times_collect, :of
  alias_method :times_map, :of

end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
facets-2.8.4 lib/core/facets/integer/of.rb
facets-2.8.3 lib/core/facets/integer/of.rb
facets-2.8.2 lib/core/facets/integer/of.rb
facets-2.8.1 lib/core/facets/integer/of.rb
facets-2.8.0 lib/core/facets/integer/of.rb
facets-2.7.0 lib/core/facets/integer/of.rb
facets-2.6.0 lib/core/facets/integer/of.rb
facets-2.4.0 lib/facets/integer/of.rb
facets-2.4.1 lib/facets/integer/of.rb
facets-2.4.4 lib/core/facets/integer/of.rb
facets-2.4.3 lib/core/facets/integer/of.rb
facets-2.4.2 lib/core/facets/integer/of.rb
facets-2.4.5 lib/core/facets/integer/of.rb
facets-2.5.0 lib/core/facets/integer/of.rb
facets-2.5.1 lib/core/facets/integer/of.rb
facets-2.5.2 lib/core/facets/integer/of.rb
mack-facets-0.8.2 lib/gems/facets-2.4.5/lib/core/facets/integer/of.rb