Class: ConfigLoader::Json
Instance Attribute Summary
Attributes inherited from Base
#ext, #file_name, #file_path, #locale, #path, #root
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(file_path, options = {}) ⇒ Json
constructor
A new instance of Json.
- #reg_ext_format ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(file_path, options = {}) ⇒ Json
Returns a new instance of Json.
5 6 7 8 |
# File 'lib/config_loader/json.rb', line 5 def initialize file_path, = {} file_path = "#{file_path}.json" unless path?(file_path) super file_path, end |
Instance Method Details
#content ⇒ Object
10 11 12 |
# File 'lib/config_loader/json.rb', line 10 def content @content ||= JSON.parse file_content.read end |
#reg_ext_format ⇒ Object
14 15 16 |
# File 'lib/config_loader/json.rb', line 14 def reg_ext_format 'json' end |