Class: Eco::API::Common::Session::BaseSession

Inherits:
Object
  • Object
show all
Defined in:
lib/eco/api/common/session/base_session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(e) ⇒ BaseSession

Returns a new instance of BaseSession.



14
15
16
17
# File 'lib/eco/api/common/session/base_session.rb', line 14

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

Instance Attribute Details

#api(version: nil) ⇒ Object (readonly)

Returns the value of attribute api.



11
12
13
# File 'lib/eco/api/common/session/base_session.rb', line 11

def api
  @api
end

#configObject

Returns the value of attribute config.



7
8
9
# File 'lib/eco/api/common/session/base_session.rb', line 7

def config
  @config
end

#environmentObject Also known as: enviro

Returns the value of attribute environment.



7
8
9
# File 'lib/eco/api/common/session/base_session.rb', line 7

def environment
  @environment
end

#file_managerObject (readonly)

Returns the value of attribute file_manager.



11
12
13
# File 'lib/eco/api/common/session/base_session.rb', line 11

def file_manager
  @file_manager
end

#loggerObject (readonly)

Returns the value of attribute logger.



11
12
13
# File 'lib/eco/api/common/session/base_session.rb', line 11

def logger
  @logger
end

#sessionObject

Returns the value of attribute session.



6
7
8
# File 'lib/eco/api/common/session/base_session.rb', line 6

def session
  @session
end

Instance Method Details

#enviro=Object

Sets the attribute environment

Parameters:

  • value

    the value to set the attribute environment to.



9
10
11
# File 'lib/eco/api/common/session/base_session.rb', line 9

def environment=(value)
  @environment = value
end

#fatal(msg) ⇒ Object

TODO: paremeter for the exception



69
70
71
72
# File 'lib/eco/api/common/session/base_session.rb', line 69

def fatal(msg)
  logger.fatal(msg)
  raise msg
end

#fmObject

Returns the value of attribute file_manager.



12
13
14
# File 'lib/eco/api/common/session/base_session.rb', line 12

def file_manager
  @file_manager
end

#mailerObject



40
41
42
# File 'lib/eco/api/common/session/base_session.rb', line 40

def mailer
  enviro.mailer
end

#mailer?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/eco/api/common/session/base_session.rb', line 44

def mailer?
  enviro.mailer?
end

#s3uploaderObject



56
57
58
# File 'lib/eco/api/common/session/base_session.rb', line 56

def s3uploader
  enviro.s3uploader
end

#s3uploader?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/eco/api/common/session/base_session.rb', line 60

def s3uploader?
  enviro.s3uploader?
end

#sftpObject



48
49
50
# File 'lib/eco/api/common/session/base_session.rb', line 48

def sftp
  enviro.sftp
end

#sftp?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/eco/api/common/session/base_session.rb', line 52

def sftp?
  enviro.sftp?
end