Sha256: d49eb11b84bd8b31554f0e1744e00c8d3c21d94d2122a23415d10ac3763dd139
Contents?: true
Size: 1.34 KB
Versions: 2
Compression:
Stored size: 1.34 KB
Contents
module Eco module API module Common module Session class Environment include Common::People attr_reader :config attr_reader :api #, :host, :version attr_reader :file_manager, :logger alias_method :fm, :file_manager def initialize(init = {}) init = init.conf if init.is_a?(Environment) msg = "Wrong Session::Environment initializer. Expected Hash or Environment object. Given: #{init}" raise msg unless init.is_a?(SessionConfig) @config = init @file_manager = Eco::API::Common::Session::FileManager.new(enviro: self) @logger = Session::Logger.new(enviro: self) new_api end def new_api return nil unless config.apis.active_api log_connection = config.logger.log_connection? log = log_connection ? @logger : ::Logger.new(IO::NULL) api = config.api(log) unless log_connection logger.info("Created connection pointing to '#{config.apis.active_api.host}' in '#{config.apis.active_api.mode}' mode") api.logger.level = ::Logger::UNKNOWN end @api = api api end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
eco-helpers-0.6.2 | lib/eco/api/common/session/environment.rb |
eco-helpers-0.6.1 | lib/eco/api/common/session/environment.rb |