Sha256: b550d32f7d7cc606f3ac70a32e2d7260cd520b4290b37d8dee2b8b2c6d92cbcc
Contents?: true
Size: 789 Bytes
Versions: 49
Compression:
Stored size: 789 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 end
Version data entries
49 entries across 49 versions & 1 rubygems