Class: Darthjee::CoreExt::Hash::ChainFetcher Private
- Defined in:
- lib/darthjee/core_ext/hash/chain_fetcher.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible for running ::Hash#chain_fetch
Instance Method Summary collapse
-
#fetch ⇒ Object
private
Crawls through the hash fetching the keys in chain.
-
#initialize(hash, *keys, &block) ⇒ ChainFetcher
constructor
private
A new instance of ChainFetcher.
Constructor Details
#initialize(hash, *keys, &block) ⇒ ChainFetcher
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ChainFetcher.
14 15 16 17 18 |
# File 'lib/darthjee/core_ext/hash/chain_fetcher.rb', line 14 def initialize(hash, *keys, &block) @hash = hash @keys = keys @block = block end |
Instance Method Details
#fetch ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Crawls through the hash fetching the keys in chain
25 26 27 28 |
# File 'lib/darthjee/core_ext/hash/chain_fetcher.rb', line 25 def fetch return fetch_with_block if block.present? fetch_without_block end |