Class: Eco::API::Common::Session::BaseSession
Instance Attribute Summary collapse
Instance Method Summary
collapse
#log
Constructor Details
Returns a new instance of BaseSession.
13
14
15
16
17
18
|
# File 'lib/eco/api/common/session/base_session.rb', line 13
def initialize(env)
msg = "Expected object Eco::API::Common::Session::Environment. Given: #{env.class}"
raise msg unless env.is_a?(Environment)
self.environment = env
end
|
Instance Attribute Details
30
31
32
|
# File 'lib/eco/api/common/session/base_session.rb', line 30
def config
enviro.config
end
|
#environment ⇒ Object
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
|
20
21
22
|
# File 'lib/eco/api/common/session/base_session.rb', line 20
def session
enviro.session
end
|
Instance Method Details
#api(version: nil) ⇒ Object
34
35
36
|
# File 'lib/eco/api/common/session/base_session.rb', line 34
def api(version: nil)
enviro.api(version: version)
end
|
#api?(version: nil) ⇒ Boolean
38
39
40
|
# File 'lib/eco/api/common/session/base_session.rb', line 38
def api?(version: nil)
enviro.api?(version: version)
end
|
#fatal(msg) ⇒ Object
TODO: paremeter for the exception
76
77
78
79
|
# File 'lib/eco/api/common/session/base_session.rb', line 76
def fatal(msg)
logger.fatal(msg)
raise msg
end
|
#file_manager ⇒ Object
Also known as:
fm
42
43
44
|
# File 'lib/eco/api/common/session/base_session.rb', line 42
def file_manager
enviro.file_manager
end
|
71
72
73
|
# File 'lib/eco/api/common/session/base_session.rb', line 71
def logger
enviro.logger
end
|
47
48
49
|
# File 'lib/eco/api/common/session/base_session.rb', line 47
def mailer
enviro.mailer
end
|
#mailer? ⇒ Boolean
51
52
53
|
# File 'lib/eco/api/common/session/base_session.rb', line 51
def mailer?
enviro.mailer?
end
|
#s3uploader ⇒ Object
63
64
65
|
# File 'lib/eco/api/common/session/base_session.rb', line 63
def s3uploader
enviro.s3uploader
end
|
#s3uploader? ⇒ Boolean
67
68
69
|
# File 'lib/eco/api/common/session/base_session.rb', line 67
def s3uploader?
enviro.s3uploader?
end
|
55
56
57
|
# File 'lib/eco/api/common/session/base_session.rb', line 55
def sftp
enviro.sftp
end
|
#sftp? ⇒ Boolean
59
60
61
|
# File 'lib/eco/api/common/session/base_session.rb', line 59
def sftp?
enviro.sftp?
end
|