Sha256: e664add4902e2c48085d913c169603bfd3c09403f9038abfa7d092b963325c29
Contents?: true
Size: 628 Bytes
Versions: 23
Compression:
Stored size: 628 Bytes
Contents
module IPAddrExtensions extend ActiveSupport::Concern included do begin remove_method :== rescue NameError => e puts e.message end alias_method :spaceship_without_rescue, :<=> alias_method :<=>, :spaceship_with_rescue alias_method_chain :include?, :rescue end def spaceship_with_rescue(other) begin spaceship_without_rescue(other) rescue ArgumentError false end end def include_with_rescue?(other) begin include_without_rescue?(other) rescue ArgumentError false end end end IPAddr.send(:include, IPAddrExtensions)
Version data entries
23 entries across 23 versions & 1 rubygems