Class: Darthjee::CoreExt::Hash::ChainFetcher
- Defined in:
- lib/darthjee/core_ext/hash/chain_fetcher.rb
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(hash, *keys, &block) ⇒ ChainFetcher
constructor
A new instance of ChainFetcher.
Constructor Details
#initialize(hash, *keys, &block) ⇒ ChainFetcher
Returns a new instance of ChainFetcher.
7 8 9 10 11 |
# File 'lib/darthjee/core_ext/hash/chain_fetcher.rb', line 7 def initialize(hash, *keys, &block) @hash = hash @keys = keys @block = block end |
Instance Method Details
#fetch ⇒ Object
13 14 15 |
# File 'lib/darthjee/core_ext/hash/chain_fetcher.rb', line 13 def fetch block.present? ? fetch_with_block : fetch_without_block end |