Class: Arstotzka::Fetcher Private
- Inherits:
-
Object
- Object
- Arstotzka::Fetcher
- Includes:
- Base
- Defined in:
- lib/arstotzka/fetcher.rb,
lib/arstotzka/fetcher/cache.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 orquestrating the fetch value from the hash and post-processing it
Defined Under Namespace
Classes: Cache
Instance Method Summary collapse
-
#==(other) ⇒ TrueClass, FalseClass
private
Checks if other equals self.
-
#fetch ⇒ Object
private
Crawls the hash for the value.
-
#hash_reader ⇒ Arstotzka::HashReader
private
private
Reader responsible for fetching hash from instance.
-
#initialize(options_hash = {}) ⇒ Fetcher
constructor
private
Creates an instance of Artotzka::Fetcher.
Methods included from Base
Constructor Details
#iniitalize(options_hash = {}) ⇒ Fetcher #iniitalize(options) ⇒ Fetcher
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.
Creates an instance of Artotzka::Fetcher
22 23 24 |
# File 'lib/arstotzka/fetcher.rb', line 22 def initialize( = {}) self. = end |
Instance Method Details
#==(other) ⇒ TrueClass, FalseClass
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.
Checks if other equals self
97 98 99 100 101 |
# File 'lib/arstotzka/fetcher.rb', line 97 def ==(other) return false unless other.class == self.class == other. end |
#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 the hash for the value
After the crawling, final transformation is applied on the final result (collection not value)
86 87 88 89 90 |
# File 'lib/arstotzka/fetcher.rb', line 86 def fetch Cache.new() do fetch_value end.fetch end |
#hash_reader ⇒ Arstotzka::HashReader (private)
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.
Reader responsible for fetching hash from instance
162 163 164 |
# File 'lib/arstotzka/fetcher.rb', line 162 def hash_reader @hash_reader ||= HashReader.new() end |