Class: Myxi::Environment
- Inherits:
-
Object
- Object
- Myxi::Environment
- Defined in:
- lib/myxi/environment.rb
Defined Under Namespace
Classes: AuthRequired, Error
Instance Attribute Summary collapse
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #auth_required! ⇒ Object
-
#initialize(session, payload = {}) ⇒ Environment
constructor
A new instance of Environment.
Constructor Details
#initialize(session, payload = {}) ⇒ Environment
Returns a new instance of Environment.
7 8 9 |
# File 'lib/myxi/environment.rb', line 7 def initialize(session, payload = {}) @session, @payload = session, payload end |
Instance Attribute Details
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
12 13 14 |
# File 'lib/myxi/environment.rb', line 12 def payload @payload end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
11 12 13 |
# File 'lib/myxi/environment.rb', line 11 def session @session end |
Instance Method Details
#auth_required! ⇒ Object
14 15 16 17 18 |
# File 'lib/myxi/environment.rb', line 14 def auth_required! if session.auth_object.nil? raise AuthRequired, "Authentication is required for this action" end end |