Class: CC::Config::YAMLAdapter
- Inherits:
-
Object
- Object
- CC::Config::YAMLAdapter
- Defined in:
- lib/cc/config/yaml_adapter.rb
Constant Summary collapse
- DEFAULT_PATH =
".codeclimate.yml".freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(yaml = {}) ⇒ YAMLAdapter
constructor
A new instance of YAMLAdapter.
Constructor Details
#initialize(yaml = {}) ⇒ YAMLAdapter
Returns a new instance of YAMLAdapter.
12 13 14 15 16 |
# File 'lib/cc/config/yaml_adapter.rb', line 12 def initialize(yaml = {}) @config = yaml || {} upconvert_legacy_yaml! end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/cc/config/yaml_adapter.rb', line 6 def config @config end |
Class Method Details
.load(path = DEFAULT_PATH) ⇒ Object
8 9 10 |
# File 'lib/cc/config/yaml_adapter.rb', line 8 def self.load(path = DEFAULT_PATH) new(::YAML.safe_load(File.read(path))) end |