Sha256: 618d887f1a09ed2616e98a98032d7a669b4834b5ffdaeaa28de7e81f6ccd21ca

Contents?: true

Size: 410 Bytes

Versions: 11

Compression:

Stored size: 410 Bytes

Contents

class Object
  def ensure_present!(*args)
    raise 'arguments must be non null' if args.any?(&:blank?)
  end

  def to_stringified_h
    to_h.stringify_keys
  end

  def defaulting(value)
    if block_given? && !nil?
      result = yield self
    else
      result = self
    end
    result || value
  end

  def struct(hash = {})
    hash.to_struct
  end

  def like?(other)
    to_s == other.to_s
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mumukit-core-1.11.0 lib/mumukit/core/object.rb
mumukit-core-1.10.1 lib/mumukit/core/object.rb
mumukit-core-1.10.0 lib/mumukit/core/object.rb
mumukit-core-1.9.0 lib/mumukit/core/object.rb
mumukit-core-1.8.0 lib/mumukit/core/object.rb
mumukit-core-1.7.0 lib/mumukit/core/object.rb
mumukit-core-1.6.0 lib/mumukit/core/object.rb
mumukit-core-1.5.2 lib/mumukit/core/object.rb
mumukit-core-1.5.1 lib/mumukit/core/object.rb
mumukit-core-1.5.0 lib/mumukit/core/object.rb
mumukit-core-1.4.0 lib/mumukit/core/object.rb