Sha256: 96d142e036e5ca6b6ac81251c35ddaaeebfe9e45bd79d84d38ae7220d416e8ac

Contents?: true

Size: 1.25 KB

Versions: 21

Compression:

Stored size: 1.25 KB

Contents

module Eco
  module API
    module Common
      module Session
        class BaseSession

          include Common::People

          attr_accessor :session
          attr_accessor :environment, :config
          alias_method :enviro, :environment
          alias_method :enviro=, :environment=

          attr_reader  :api, :file_manager, :logger
          alias_method :fm, :file_manager

          def initialize(e)
            raise "Expected object Eco::API::Common::Session::Environment. Given: #{e.class}" unless e.is_a?(Environment)
            self.environment = e
          end

          def session
            enviro.session
          end

          def environment=(value)
            @environment = nil
            @environment = value if value.is_a?(Environment)
          end

          def config
            enviro.config
          end

          def api
            enviro.api
          end

          def file_manager
            enviro.file_manager
          end

          def logger
            enviro.logger
          end

          # TODO: paremeter for the exception
          def fatal(msg)
            logger.fatal(msg)
            raise msg
          end

        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
eco-helpers-1.0.11 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.10 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.9 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.8 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.7 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.6 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.5 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.4 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.3 lib/eco/api/common/session/base_session.rb
eco-helpers-0.9.5 lib/eco/api/common/session/base_session.rb
eco-helpers-1.0.2 lib/eco/api/common/session/base_session.rb
eco-helpers-0.9.4 lib/eco/api/common/session/base_session.rb
eco-helpers-0.9.3 lib/eco/api/common/session/base_session.rb
eco-helpers-0.9.2 lib/eco/api/common/session/base_session.rb
eco-helpers-0.9.1 lib/eco/api/common/session/base_session.rb
eco-helpers-0.8.4 lib/eco/api/common/session/base_session.rb
eco-helpers-0.8.3 lib/eco/api/common/session/base_session.rb
eco-helpers-0.8.2 lib/eco/api/common/session/base_session.rb
eco-helpers-0.8.1 lib/eco/api/common/session/base_session.rb
eco-helpers-0.7.2 lib/eco/api/common/session/base_session.rb