Method: Interpol::HashFetcher#fetch_from

Defined in:
lib/interpol/endpoint.rb

#fetch_from(hash, key) ⇒ Object

Unfortunately, on JRuby 1.9, the error raised from Hash#fetch when the key is not found does not include the key itself :(. So we work around it here.



61
62
63
64
65
# File 'lib/interpol/endpoint.rb', line 61

def fetch_from(hash, key)
  hash.fetch(key) do
    raise ArgumentError.new("key not found: #{key.inspect}")
  end
end