Class: Fetchers::Mock
- Inherits:
-
Object
- Object
- Fetchers::Mock
- Defined in:
- lib/fetchers/mock.rb
Class Method Summary collapse
Instance Method Summary collapse
- #archive_path ⇒ Object
- #cache_key ⇒ Object
- #fetch(_path) ⇒ Object
-
#initialize(data) ⇒ Mock
constructor
A new instance of Mock.
- #resolved_source ⇒ Object
Constructor Details
#initialize(data) ⇒ Mock
Returns a new instance of Mock.
14 15 16 |
# File 'lib/fetchers/mock.rb', line 14 def initialize(data) @data = data end |
Class Method Details
.resolve(target) ⇒ Object
8 9 10 11 12 |
# File 'lib/fetchers/mock.rb', line 8 def self.resolve(target) return nil unless target.is_a? Hash new(target) end |
Instance Method Details
#archive_path ⇒ Object
22 23 24 |
# File 'lib/fetchers/mock.rb', line 22 def archive_path { mock: @data } end |
#cache_key ⇒ Object
30 31 32 |
# File 'lib/fetchers/mock.rb', line 30 def cache_key "" end |
#fetch(_path) ⇒ Object
18 19 20 |
# File 'lib/fetchers/mock.rb', line 18 def fetch(_path) archive_path end |
#resolved_source ⇒ Object
26 27 28 |
# File 'lib/fetchers/mock.rb', line 26 def resolved_source { mock_fetcher: true } end |