Class: FluidFeatures::Config
- Inherits:
-
Object
- Object
- FluidFeatures::Config
- Defined in:
- lib/fluidfeatures/config.rb
Instance Attribute Summary collapse
-
#vars ⇒ Object
Returns the value of attribute vars.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(source, environment = nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(source, environment = nil) ⇒ Config
Returns a new instance of Config.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fluidfeatures/config.rb', line 10 def initialize(source, environment=nil) if source.is_a? String init_from_file(source, environment) elsif source.is_a? Hash init_from_hash(source) else raise FFeaturesConfigInvalid.new( "Invalid 'source' given. Expected file path String or Hash. Got #{source.class}" ) end if @vars["cache"] and @vars["cache"]["limit"] @vars["cache"]["limit"] = self.class.parse_file_size(vars["cache"]["limit"]) end end |
Instance Attribute Details
#vars ⇒ Object
Returns the value of attribute vars.
8 9 10 |
# File 'lib/fluidfeatures/config.rb', line 8 def vars @vars end |
Instance Method Details
#[](name) ⇒ Object
25 26 27 |
# File 'lib/fluidfeatures/config.rb', line 25 def [](name) @vars[name.to_s] end |