Class: Eco::API::Common::Session::BaseSession
- Inherits:
-
Object
- Object
- Eco::API::Common::Session::BaseSession
- Includes:
- People
- Defined in:
- lib/eco/api/common/session/base_session.rb
Direct Known Subclasses
Session, Session::Batch, Session::Batch::Job, Session::Batch::Jobs, Session::Batch::JobsGroups, Session::Batch::Status, Session::Task
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#config ⇒ Object
Returns the value of attribute config.
-
#environment ⇒ Object
(also: #enviro)
Returns the value of attribute environment.
-
#file_manager ⇒ Object
readonly
Returns the value of attribute file_manager.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
-
#enviro= ⇒ Object
Sets the attribute environment.
-
#fatal(msg) ⇒ Object
TODO: paremeter for the exception.
-
#fm ⇒ Object
Returns the value of attribute file_manager.
-
#initialize(e) ⇒ BaseSession
constructor
A new instance of BaseSession.
- #mailer ⇒ Object
- #mailer? ⇒ Boolean
- #s3uploader ⇒ Object
- #s3uploader? ⇒ Boolean
- #sftp ⇒ Object
- #sftp? ⇒ Boolean
Constructor Details
#initialize(e) ⇒ BaseSession
Returns a new instance of BaseSession.
17 18 19 20 |
# File 'lib/eco/api/common/session/base_session.rb', line 17 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 ⇒ Object (readonly)
Returns the value of attribute api.
14 15 16 |
# File 'lib/eco/api/common/session/base_session.rb', line 14 def api @api end |
#config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/eco/api/common/session/base_session.rb', line 10 def config @config end |
#environment ⇒ Object Also known as: enviro
Returns the value of attribute environment.
10 11 12 |
# File 'lib/eco/api/common/session/base_session.rb', line 10 def environment @environment end |
#file_manager ⇒ Object (readonly)
Returns the value of attribute file_manager.
14 15 16 |
# File 'lib/eco/api/common/session/base_session.rb', line 14 def file_manager @file_manager end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
14 15 16 |
# File 'lib/eco/api/common/session/base_session.rb', line 14 def logger @logger end |
#session ⇒ Object
Returns the value of attribute session.
9 10 11 |
# File 'lib/eco/api/common/session/base_session.rb', line 9 def session @session end |
Instance Method Details
#enviro= ⇒ Object
Sets the attribute environment
12 13 14 |
# File 'lib/eco/api/common/session/base_session.rb', line 12 def environment=(value) @environment = value end |
#fatal(msg) ⇒ Object
TODO: paremeter for the exception
72 73 74 75 |
# File 'lib/eco/api/common/session/base_session.rb', line 72 def fatal(msg) logger.fatal(msg) raise msg end |
#fm ⇒ Object
Returns the value of attribute file_manager.
15 16 17 |
# File 'lib/eco/api/common/session/base_session.rb', line 15 def file_manager @file_manager end |
#mailer ⇒ Object
43 44 45 |
# File 'lib/eco/api/common/session/base_session.rb', line 43 def mailer enviro.mailer end |
#mailer? ⇒ Boolean
47 48 49 |
# File 'lib/eco/api/common/session/base_session.rb', line 47 def mailer? enviro.mailer? end |
#s3uploader ⇒ Object
59 60 61 |
# File 'lib/eco/api/common/session/base_session.rb', line 59 def s3uploader enviro.s3uploader end |
#s3uploader? ⇒ Boolean
63 64 65 |
# File 'lib/eco/api/common/session/base_session.rb', line 63 def s3uploader? enviro.s3uploader? end |
#sftp ⇒ Object
51 52 53 |
# File 'lib/eco/api/common/session/base_session.rb', line 51 def sftp enviro.sftp end |
#sftp? ⇒ Boolean
55 56 57 |
# File 'lib/eco/api/common/session/base_session.rb', line 55 def sftp? enviro.sftp? end |