module Wallaby::Utils

Utils

Public Class Methods

clone(object) click to toggle source

@see stackoverflow.com/a/8710663/1326499 @param object [Object] @return [Object] a clone object

# File lib/utils/wallaby/utils.rb, line 9
def self.clone(object)
  ::Marshal.load(::Marshal.dump(object))
end
inspect(object) click to toggle source

@param object [Object, nil] @return [String] inspection string for the given object

# File lib/utils/wallaby/utils.rb, line 15
def self.inspect(object)
  return 'nil' unless object
  return object.name if object.is_a? Class

  "#{object.class}##{object.id}"
end