Class: Etcher::Loaders::JSON
- Inherits:
-
Object
- Object
- Etcher::Loaders::JSON
- Defined in:
- lib/etcher/loaders/json.rb
Overview
Loads a JSON configuration.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(path, fallback: Core::EMPTY_HASH, logger: LOGGER) ⇒ JSON
constructor
A new instance of JSON.
Constructor Details
Instance Method Details
#call ⇒ Object
20 21 22 23 24 |
# File 'lib/etcher/loaders/json.rb', line 20 def call Success ::JSON.load_file(path) rescue Errno::ENOENT, TypeError then debug_invalid_path rescue ::JSON::ParserError => error then content_failure error end |