Sha256: 2ace4bd39508a56840d9c9b74f23c9c5ca0f5f3d927900f7bea198ff3ac05f28
Contents?: true
Size: 361 Bytes
Versions: 14
Compression:
Stored size: 361 Bytes
Contents
class VariableArray < Array def ==(other) if other.is_a?(Array) comp = self[1..(self.length - 1)] return comp.first == other.first else super end end def collect(&block) self.class.new.tap do |ret| self.each_with_index do |el, i| ret[i] = block.call(el) end end end alias_method :eql?, :== end
Version data entries
14 entries across 14 versions & 1 rubygems