Class: Isomer::Sources::Environment
- Defined in:
- lib/isomer/sources/environment.rb
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Attributes inherited from Base
#configuration, #errors, #parameters
Instance Method Summary collapse
- #convert_case? ⇒ Boolean
-
#initialize(parameters, options = {}) ⇒ Environment
constructor
A new instance of Environment.
- #load ⇒ Object
Methods inherited from Base
#for, #load_and_validate, #validate
Constructor Details
#initialize(parameters, options = {}) ⇒ Environment
Returns a new instance of Environment.
4 5 6 7 8 9 |
# File 'lib/isomer/sources/environment.rb', line 4 def initialize(parameters, ={}) @convert_case = .has_key?(:convert_case) ? [:convert_case] : true @prefix = [:prefix] super(parameters) end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
2 3 4 |
# File 'lib/isomer/sources/environment.rb', line 2 def prefix @prefix end |
Instance Method Details
#convert_case? ⇒ Boolean
18 19 20 |
# File 'lib/isomer/sources/environment.rb', line 18 def convert_case? @convert_case end |
#load ⇒ Object
11 12 13 14 15 16 |
# File 'lib/isomer/sources/environment.rb', line 11 def load @configuration = {} parameters.each do |parameter| @configuration[parameter.name] = ENV[ convert_name(parameter.name) ] end end |