Sha256: e706c87d5f447afad801153c3e24e5f356b031ded11d3069b53545a45ce41274

Contents?: true

Size: 494 Bytes

Versions: 15

Compression:

Stored size: 494 Bytes

Contents

# Enumerable extensions.
module Enumerable
  # Invokes the specified method for each item, along with the supplied
  # arguments.
  def send_each(sym, *args)
    each {|i| i.send(sym, *args)}
  end
end

# Range extensions
class Range
  # Returns the interval between the beginning and end of the range.
  def interval
    last - first
  end
end

# Object extensions
class Object
  def is_one_of?(*classes)
    classes.each {|c| return c if is_a?(c)}
    nil
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sequel_core-1.0.10 lib/sequel_core/core_ext.rb
sequel_core-1.0.4 lib/sequel_core/core_ext.rb
sequel_core-1.0.8.2 lib/sequel_core/core_ext.rb
sequel_core-1.0.7 lib/sequel_core/core_ext.rb
sequel_core-1.0.5 lib/sequel_core/core_ext.rb
sequel_core-1.0.4.1 lib/sequel_core/core_ext.rb
sequel_core-1.0.6 lib/sequel_core/core_ext.rb
sequel_core-1.0.8.1 lib/sequel_core/core_ext.rb
sequel_core-1.0.9.1 lib/sequel_core/core_ext.rb
sequel_core-1.0.8 lib/sequel_core/core_ext.rb
sequel_core-1.2.1 lib/sequel_core/core_ext.rb
sequel_core-1.1 lib/sequel_core/core_ext.rb
sequel_core-1.4.0 lib/sequel_core/core_ext.rb
sequel_core-1.2 lib/sequel_core/core_ext.rb
sequel_core-1.3 lib/sequel_core/core_ext.rb