class WTForum::Session

Attributes

token[R]
wtforum[R]

Public Class Methods

create(wtforum, response) click to toggle source
# 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.message == "Error: The specified user does not exist."
    raise WTForum::User::NotFound
  else
    raise
  end
end
new(wtforum, token) click to toggle source
# File lib/wtforum/session.rb, line 14
def initialize wtforum, token
  @wtforum = wtforum
  @token = token
end

Public Instance Methods

auth_token_image_url() click to toggle source
# File lib/wtforum/session.rb, line 21
def auth_token_image_url
  "http://#{wtforum.domain}/register/dologin?authtoken=#{token}"
end