Class: WTForum::Session
- Inherits:
-
Object
- Object
- WTForum::Session
- Defined in:
- lib/wtforum/session.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#wtforum ⇒ Object
readonly
Returns the value of attribute wtforum.
Class Method Summary collapse
Instance Method Summary collapse
- #auth_token_image_url ⇒ Object
-
#initialize(wtforum, token) ⇒ Session
constructor
A new instance of Session.
Constructor Details
#initialize(wtforum, token) ⇒ Session
Returns a new instance of Session.
14 15 16 17 |
# File 'lib/wtforum/session.rb', line 14 def initialize wtforum, token @wtforum = wtforum @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
19 20 21 |
# File 'lib/wtforum/session.rb', line 19 def token @token end |
#wtforum ⇒ Object (readonly)
Returns the value of attribute wtforum.
19 20 21 |
# File 'lib/wtforum/session.rb', line 19 def wtforum @wtforum end |
Class Method Details
.create(wtforum, response) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/wtforum/session.rb', line 3 def self.create wtforum, response auth_token = WTForum.extract_value(:authtoken, from: response.body) new(wtforum, auth_token) rescue WTForumError => e if e. == "Error: The specified user does not exist." raise WTForum::User::NotFound else raise end end |
Instance Method Details
#auth_token_image_url ⇒ Object
21 22 23 |
# File 'lib/wtforum/session.rb', line 21 def auth_token_image_url "http://#{wtforum.domain}/register/dologin?authtoken=#{token}" end |