Module: Garb::Session::Methods
- Included in:
- Garb::Session, Garb::Session
- Defined in:
- lib/garb/session.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
-
#authsub_token ⇒ Object
Returns the value of attribute authsub_token.
-
#email ⇒ Object
Returns the value of attribute email.
Instance Method Summary collapse
- #authsub_user? ⇒ Boolean
-
#login(email, password, opts = {}) ⇒ Object
use only for single user authentication.
- #oauth_user? ⇒ Boolean
- #single_user? ⇒ Boolean
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/garb/session.rb', line 4 def access_token @access_token end |
#auth_token ⇒ Object
Returns the value of attribute auth_token.
4 5 6 |
# File 'lib/garb/session.rb', line 4 def auth_token @auth_token end |
#authsub_token ⇒ Object
Returns the value of attribute authsub_token.
4 5 6 |
# File 'lib/garb/session.rb', line 4 def authsub_token @authsub_token end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/garb/session.rb', line 4 def email @email end |
Instance Method Details
#authsub_user? ⇒ Boolean
21 22 23 |
# File 'lib/garb/session.rb', line 21 def authsub_user? !authsub_token.nil? end |
#login(email, password, opts = {}) ⇒ Object
use only for single user authentication
7 8 9 10 11 |
# File 'lib/garb/session.rb', line 7 def login(email, password, opts={}) self.email = email auth_request = AuthenticationRequest.new(email, password, opts) self.auth_token = auth_request.auth_token(opts) end |
#oauth_user? ⇒ Boolean
17 18 19 |
# File 'lib/garb/session.rb', line 17 def oauth_user? !access_token.nil? end |
#single_user? ⇒ Boolean
13 14 15 |
# File 'lib/garb/session.rb', line 13 def single_user? auth_token && auth_token.is_a?(String) end |