Sha256: 8402f6a6c24238efa9dfa679773a7fceca9b59e8d12ca7b1f99164a36572b4a0

Contents?: true

Size: 412 Bytes

Versions: 10

Compression:

Stored size: 412 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 filled?
    self == false || present?
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/mumukit-core-1.19.2/lib/mumukit/core/object.rb
mumukit-core-1.19.2 lib/mumukit/core/object.rb
mumukit-core-1.20.0 lib/mumukit/core/object.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/mumukit-core-1.19.1/lib/mumukit/core/object.rb
mumukit-core-1.19.1 lib/mumukit/core/object.rb
mumukit-core-1.19.0 lib/mumukit/core/object.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/mumukit-core-1.18.0/lib/mumukit/core/object.rb
mumukit-core-1.18.0 lib/mumukit/core/object.rb
mumukit-core-1.17.0 lib/mumukit/core/object.rb
mumukit-core-1.16.0 lib/mumukit/core/object.rb