Class: JsonStatham::Requests::Reader
- Defined in:
- lib/json_statham/requests/reader.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#base_path, call, #file_path, #folder?, #folder_path, #initialize, #schema_name, #splitted_name
Constructor Details
This class inherits a constructor from JsonStatham::Requests::Base
Instance Method Details
#call ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/json_statham/requests/reader.rb', line 6 def call return {} unless File.exist?(file_path) JSON.parse(File.read(file_path)) rescue JSON::ParserError {} end |