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.
12 13 14 15 16 |
# File 'lib/darthjee/core_ext/hash/chain_fetcher.rb', line 12 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
23 24 25 |
# File 'lib/darthjee/core_ext/hash/chain_fetcher.rb', line 23 def fetch block.present? ? fetch_with_block : fetch_without_block end |