class RoadForest::Authorization::AuthEntity

Attributes

password[RW]
token[RW]
username[RW]

Public Class Methods

new() click to toggle source
# File lib/roadforest/authorization/auth-entity.rb, line 4
def initialize
  @authenticated = false
end

Public Instance Methods

authenticate!() click to toggle source
# File lib/roadforest/authorization/auth-entity.rb, line 21
def authenticate!
  @authenticated = true
end
authenticate_by_password(password) click to toggle source
# File lib/roadforest/authorization/auth-entity.rb, line 13
def authenticate_by_password(password)
  @authenticated = (!password.nil? and password == @password)
end
authenticate_by_token(token) click to toggle source
# File lib/roadforest/authorization/auth-entity.rb, line 17
def authenticate_by_token(token)
  @authenticated = (!token.nil? and token == @token)
end
authenticated?() click to toggle source
# File lib/roadforest/authorization/auth-entity.rb, line 9
def authenticated?
  !!@authenticated
end