class Object
Public Instance Methods
as_matcher_json(obj, options = {})
click to toggle source
# File lib/mumukit/core/rspec.rb, line 3 def as_matcher_json(obj, options = {}) if obj.instance_of? String JSON.parse(obj).with_indifferent_access.as_json options else obj.as_json options end end
defaulting(value) { |self| ... }
click to toggle source
# File lib/mumukit/core/object.rb, line 10 def defaulting(value) if block_given? && !nil? result = yield self else result = self end result || value end
ensure_present!(*args)
click to toggle source
# File lib/mumukit/core/object.rb, line 2 def ensure_present!(*args) raise 'arguments must be non null' if args.any?(&:blank?) end
filled?()
click to toggle source
# File lib/mumukit/core/object.rb, line 23 def filled? self == false || present? end
like?(other)
click to toggle source
# File lib/mumukit/core/likeability.rb, line 2 def like?(other) to_s == other.to_s end
struct(hash = {})
click to toggle source
# File lib/mumukit/core/object.rb, line 19 def struct(hash = {}) hash.to_struct end
to_stringified_h()
click to toggle source
# File lib/mumukit/core/object.rb, line 6 def to_stringified_h to_h.stringify_keys end