module Rumonade::HashExtensions::InstanceMethods

Constants

METHODS_TO_REPLACE_WITH_MONAD

Preserve native map and flatten methods for compatibility

Public Instance Methods

bind(lam = nil, &blk) click to toggle source
# File lib/rumonade/hash.rb, line 21
def bind(lam = nil, &blk)
  inject(self.class.empty) { |hsh, elt| hsh.merge((lam || blk).call(elt)) }
end
get(key) click to toggle source

@return [Option] a Some containing the value associated with key, or None if not present

# File lib/rumonade/hash.rb, line 26
def get(key)
  Option(self[key])
end