Sha256: fb2af4a81881d0dbd3d328ea07d3f14dd87c038817e949b386a9c5dfe6b8aaf5
Contents?: true
Size: 744 Bytes
Versions: 13
Compression:
Stored size: 744 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 # Provides the same functionality as ||, but treats a nil model as falsy def or(other) if self && !self.nil? return self else return other end end # Provides the same functionality as &&, treats a nil model as falsy def and(other) if self && !self.nil? return other else return self end end def html_inspect inspect.gsub('<', '<').gsub('>', '>') end # TODO: Need a real implementation of this def deep_clone Marshal.load(Marshal.dump(self)) end end
Version data entries
13 entries across 13 versions & 1 rubygems