Class: Envvy::Engine
- Inherits:
-
Rails::Engine
- Object
- Rails::Engine
- Envvy::Engine
- Defined in:
- lib/envvy/engine.rb
Class Attribute Summary collapse
-
.config_path ⇒ Object
Returns the value of attribute config_path.
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
Instance Method Summary collapse
Class Attribute Details
.config_path ⇒ Object
Returns the value of attribute config_path.
8 9 10 |
# File 'lib/envvy/engine.rb', line 8 def config_path @config_path end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
5 6 7 |
# File 'lib/envvy/engine.rb', line 5 def env @env end |
Instance Method Details
#get(key, &block) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/envvy/engine.rb', line 55 def get(key, &block) if block_given? yield self.env[key] else return self.env[key] end end |
#set_env(file) ⇒ Object
50 51 52 53 |
# File 'lib/envvy/engine.rb', line 50 def set_env file self.env = {"js_config" => {}, "config" => {}} self.env.merge! YAML.load(File.read(file)) if File.exist?(file) end |