Class: Bookends::ApplicationHelper::GlostickUserExtractor
- Inherits:
-
Object
- Object
- Bookends::ApplicationHelper::GlostickUserExtractor
- Defined in:
- app/helpers/bookends/application_helper.rb
Instance Attribute Summary collapse
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(cookies) ⇒ GlostickUserExtractor
constructor
A new instance of GlostickUserExtractor.
- #user ⇒ Object
Constructor Details
#initialize(cookies) ⇒ GlostickUserExtractor
Returns a new instance of GlostickUserExtractor.
59 60 61 62 |
# File 'app/helpers/bookends/application_helper.rb', line 59 def initialize() @secret = ENV['SESSION_COOKIE_SECRET_PRIMARY'] || ENV['SESSION_COOKIE_SECRET_SECONDARY'] @token = CGI::unescape([:heroku_user_session]) if [:heroku_user_session] end |
Instance Attribute Details
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
56 57 58 |
# File 'app/helpers/bookends/application_helper.rb', line 56 def secret @secret end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
56 57 58 |
# File 'app/helpers/bookends/application_helper.rb', line 56 def token @token end |
Instance Method Details
#user ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/helpers/bookends/application_helper.rb', line 64 def user session_info = if session_info && session_info['user'] session_info['user'] else { 'email' => '', 'full_name' => '' } end end |