Class: Fetchers::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fetchers/mock.rb

Class Method Summary collapse

Instance Method Summary collapse

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_pathObject



22
23
24
# File 'lib/fetchers/mock.rb', line 22

def archive_path
  { mock: @data }
end

#cache_keyObject



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_sourceObject



26
27
28
# File 'lib/fetchers/mock.rb', line 26

def resolved_source
  { mock_fetcher: true }
end