Class: DevSuite::Utils::FileLoader::Loader::Json
- Inherits:
-
Base
- Object
- Construct::Component::Base
- Base
- DevSuite::Utils::FileLoader::Loader::Json
- Defined in:
- lib/dev_suite/utils/file_loader/loader/json.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Construct::Component::Base
Class Method Details
.extensions ⇒ Object
9 10 11 |
# File 'lib/dev_suite/utils/file_loader/loader/json.rb', line 9 def extensions ["json"] end |
Instance Method Details
#load(path) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/dev_suite/utils/file_loader/loader/json.rb', line 14 def load(path) content = ::File.read(path) return {} if content.strip.empty? ::JSON.parse(content) end |