module Hashie::Utils

def self.integer_classes

Returns:
  • (Array) -

Other tags:
    Api: - private
def self.integer_classes
  @integer_classes ||=
    if 0.class == Integer
      [Integer]
    else
      [Fixnum, Bignum] # rubocop:disable Lint/UnifiedInteger
    end
end

def self.method_information(bound_method)

Returns:
  • (String) -

Parameters:
  • bound_method (Method) -- The method to describe.
def self.method_information(bound_method)
  if bound_method.source_location
    "defined at #{bound_method.source_location.join(':')}"
  else
    "defined in #{bound_method.owner}"
  end
end

def self.safe_dup(value)

Returns:
  • (Object) - the duplicated value

Parameters:
  • value (Object) -- the value to safely duplicate

Other tags:
    Api: - public
def self.safe_dup(value)
  case value
  when Complex, FalseClass, NilClass, Rational, Method, Symbol, TrueClass, *integer_classes
    value
  else
    value.dup
  end
end