Class: Chaindrive::Environment Abstract

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/chaindrive/environment.rb', line 7

def config
  @config
end

#config_fileObject (readonly)

Returns the value of attribute config_file.



7
8
9
# File 'lib/chaindrive/environment.rb', line 7

def config_file
  @config_file
end