Module: RevealCK::Retrieve

Overview

Retrieve the value of a symbol from a hash or fail

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
# File 'lib/reveal-ck/retrieve.rb', line 8

def self.included(base)
  base.extend(Retrieve)
end

Instance Method Details

#retrieve(symbol, hash) ⇒ Object



4
5
6
# File 'lib/reveal-ck/retrieve.rb', line 4

def retrieve(symbol, hash)
  hash[symbol] || raise("#{symbol} is required")
end