module Refinements::Object

Provides additional enhancements to the Object class.

Public Instance Methods

in?(other) click to toggle source
# File lib/refinements/object.rb, line 7
def in? other
  case other
    when Range then other.cover? self
    when ::Array, Enumerable, ::Hash, Set, ::String then other.include? self
    else fail NoMethodError, "`#{self.class}#include?` must be implemented."
  end
end
to_proc() click to toggle source
# File lib/refinements/object.rb, line 15
def to_proc
  return method(:call).to_proc if respond_to? :call

  fail NoMethodError, "`#{self.class}#call` must be implemented."
end