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