Class: Mammoth::Configuration::Providers::HashProvider
- Inherits:
-
Object
- Object
- Mammoth::Configuration::Providers::HashProvider
- Defined in:
- lib/mammoth/configuration.rb
Overview
Loads configuration from an already parsed Hash.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(data, path: nil) ⇒ HashProvider
constructor
A new instance of HashProvider.
- #load(schema_path: Configuration::DEFAULT_SCHEMA_PATH) ⇒ Mammoth::Configuration
Constructor Details
#initialize(data, path: nil) ⇒ HashProvider
Returns a new instance of HashProvider.
129 130 131 132 |
# File 'lib/mammoth/configuration.rb', line 129 def initialize(data, path: nil) @data = data @path = path || "<hash>" end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
125 126 127 |
# File 'lib/mammoth/configuration.rb', line 125 def data @data end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
125 126 127 |
# File 'lib/mammoth/configuration.rb', line 125 def path @path end |
Instance Method Details
#load(schema_path: Configuration::DEFAULT_SCHEMA_PATH) ⇒ Mammoth::Configuration
136 137 138 |
# File 'lib/mammoth/configuration.rb', line 136 def load(schema_path: Configuration::DEFAULT_SCHEMA_PATH) Configuration.new(path, schema_path: schema_path, data: deep_copy(data)).load end |