class Fragmentary::SessionUser

Public Class Methods

all() click to toggle source
# File lib/fragmentary/user_session.rb, line 47
def self.all
  @@all ||= Hash.new
end
fetch(key) click to toggle source
# File lib/fragmentary/user_session.rb, line 51
def self.fetch(key)
  all[key]
end
new(user_type, options={}) click to toggle source
# File lib/fragmentary/user_session.rb, line 55
def initialize(user_type, options={})
  if user = self.class.fetch(user_type)
    if user.options != options
      raise RangeError, "You can't redefine an existing SessionUser object: #{user_type.inspect}"
    else
      user
    end
  else
    @user_type = user_type
    @options = options
    self.class.all.merge!({user_type => self})
  end
end

Public Instance Methods

credentials() click to toggle source
# File lib/fragmentary/user_session.rb, line 69
def credentials
  options[:credentials]
end

Protected Instance Methods

options() click to toggle source
# File lib/fragmentary/user_session.rb, line 74
def options
  @options
end