Class: CC::Config::JSONAdapter

Inherits:
CC::Config show all
Defined in:
lib/cc/config/json_adapter.rb

Constant Summary collapse

DEFAULT_PATH =
".codeclimate.json".freeze

Instance Attribute Summary collapse

Attributes inherited from CC::Config

#analysis_paths, #development, #engines, #exclude_patterns, #prepare

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CC::Config

build, #development?, #disable_plugins!, #merge

Constructor Details

#initialize(json = {}) ⇒ JSONAdapter

Returns a new instance of JSONAdapter.



12
13
14
# File 'lib/cc/config/json_adapter.rb', line 12

def initialize(json = {})
  @config = json
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



6
7
8
# File 'lib/cc/config/json_adapter.rb', line 6

def config
  @config
end

Class Method Details

.load(path = DEFAULT_PATH) ⇒ Object



8
9
10
# File 'lib/cc/config/json_adapter.rb', line 8

def self.load(path = DEFAULT_PATH)
  new(::JSON.parse(File.open(path).read))
end