Class: Separatum::Importers::JsonFile
- Inherits:
-
Object
- Object
- Separatum::Importers::JsonFile
- Defined in:
- lib/separatum/importers/json_file.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(file_name:) ⇒ JsonFile
constructor
A new instance of JsonFile.
Constructor Details
#initialize(file_name:) ⇒ JsonFile
Returns a new instance of JsonFile.
4 5 6 |
# File 'lib/separatum/importers/json_file.rb', line 4 def initialize(file_name:) @file_name = file_name end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 |
# File 'lib/separatum/importers/json_file.rb', line 8 def call(*) str = File.read(@file_name) hash = JSON.parse(str) hash.symbolize_keys end |