Class: ConfigSL::FileFormat::Json

Inherits:
Base
  • Object
show all
Defined in:
lib/configsl/file_format/json.rb

Overview

Support for JSON files.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ConfigSL::FileFormat::Base

Class Method Details

.extensionsObject



11
12
13
# File 'lib/configsl/file_format/json.rb', line 11

def self.extensions
  %i[json]
end

Instance Method Details

#readObject



15
16
17
18
19
# File 'lib/configsl/file_format/json.rb', line 15

def read
  ::JSON.parse(File.read(@file), symbolize_names: true).each do |name, value|
    yield name, value if block_given?
  end
end