Class: ConfigLoader::Json

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

Instance Attribute Summary

Attributes inherited from Base

#ext, #file_name, #file_path, #locale, #path, #root

Instance Method Summary collapse

Methods inherited from Base

#as_hash, #load

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, options = {}
  file_path = "#{file_path}.json" unless path?(file_path)
  super file_path, options
end

Instance Method Details

#contentObject



10
11
12
# File 'lib/config_loader/json.rb', line 10

def content
	@content ||= JSON.parse file_content.read
end

#reg_ext_formatObject



14
15
16
# File 'lib/config_loader/json.rb', line 14

def reg_ext_format
  'json'
end