Class: Inspec::Fetcher::Mock
- Inherits:
-
Object
- Object
- Inspec::Fetcher::Mock
- Defined in:
- lib/inspec/fetcher/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.
16 17 18 |
# File 'lib/inspec/fetcher/mock.rb', line 16 def initialize(data) @data = data end |
Class Method Details
.resolve(target) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/inspec/fetcher/mock.rb', line 8 def self.resolve(target) if (target.is_a? Hash) && ((target.keys & %i{cwd path backend}).empty?) new(target) else nil end end |
Instance Method Details
#archive_path ⇒ Object
24 25 26 |
# File 'lib/inspec/fetcher/mock.rb', line 24 def archive_path { mock: @data } end |
#cache_key ⇒ Object
32 33 34 |
# File 'lib/inspec/fetcher/mock.rb', line 32 def cache_key "" end |
#fetch(_path) ⇒ Object
20 21 22 |
# File 'lib/inspec/fetcher/mock.rb', line 20 def fetch(_path) archive_path end |
#resolved_source ⇒ Object
28 29 30 |
# File 'lib/inspec/fetcher/mock.rb', line 28 def resolved_source { mock_fetcher: true } end |