Sha256: 35d8c3134767c4a3e5cba72790c275b406359f4330d13d68449c594de4648b35
Contents?: true
Size: 613 Bytes
Versions: 16
Compression:
Stored size: 613 Bytes
Contents
class Object # Setup a default pretty_inspect # alias_method :pretty_inspect, :inspect def instance_values Hash[instance_variables.map { |name| [name[1..-1], instance_variable_get(name)] }] end def html_inspect inspect.gsub('<', '<').gsub('>', '>') end # TODO: Need a real implementation of this def deep_clone if RUBY_PLATFORM == 'opal' JSON.parse(self.to_json) else Marshal.load(Marshal.dump(self)) end end def try(*a, &b) if a.empty? && block_given? yield self else public_send(*a, &b) if respond_to?(a.first) end end end
Version data entries
16 entries across 16 versions & 1 rubygems