Class: Chaindrive::Environment Abstract
- Inherits:
-
Object
- Object
- Chaindrive::Environment
- Defined in:
- lib/chaindrive/environment.rb
Overview
This class is abstract.
Define an object container which will house all of the
information about a single kick of Chaindrive.
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#config_file ⇒ Object
readonly
Returns the value of attribute config_file.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Environment
constructor
Create a new run-time environment object to maintain application state.
Constructor Details
#initialize(opts = {}) ⇒ Environment
Create a new run-time environment object to maintain application state.
11 12 13 14 15 16 |
# File 'lib/chaindrive/environment.rb', line 11 def initialize(opts = {}) @config_file = opts[:config] if File.exists?(opts[:config]) @config_file ||= Chaindrive.root_config if File.exists?(Chaindrive.root_config) @config_file ||= Chaindrive.user_config @config = Config.new(@config_file) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/chaindrive/environment.rb', line 7 def config @config end |
#config_file ⇒ Object (readonly)
Returns the value of attribute config_file.
7 8 9 |
# File 'lib/chaindrive/environment.rb', line 7 def config_file @config_file end |