Class: Darthjee::CoreExt::Hash::ChainFetcher

Inherits:
Object
  • Object
show all
Defined in:
lib/darthjee/core_ext/hash/chain_fetcher.rb

Instance Method Summary collapse

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

#fetchObject



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