Sha256: 507026d94aa3fc451caaa18364805d2c45fb02f3b89d474b854ee7dddd426803
Contents?: true
Size: 997 Bytes
Versions: 21
Compression:
Stored size: 997 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 since ReactiveValue's only # work with method calls, we provide .or as a convience. def or(other) if self.true? return self else return other end end # Provides the same functionality as &&, but since ReactiveValue's only # work with method calls, we provide .and as a convience def and(other) if self.true? return other else return self end end def try(*a, &b) if a.empty? && block_given? yield self else __send__(*a, &b) end end def deep_cur self.cur 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
21 entries across 21 versions & 1 rubygems