Sha256: 57f4135610a2fd8feab11f52d06c975122a6f3e4c57f262f8b8778c9a2a207a8

Contents?: true

Size: 421 Bytes

Versions: 1

Compression:

Stored size: 421 Bytes

Contents

require 'hash_ish/version'
require 'hash_ish/add_default_values'
require 'hash_ish/add_instance_methods'

class HashIsh < Hash
  def initialize(kwargs = {}, defaults = {})
    default_kwargs = AddDefaultValues.new.add(kwargs, defaults)
    decorate_self(self, default_kwargs)
  end

  def decorate_self(hash_ish, kwargs)
    hash_ish.tap do |hash_ish|
      AddInstanceMethods.new.add(hash_ish, kwargs)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hash_ish-0.3.0 lib/hash_ish.rb