Class: Rack::Session::SessionId

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/session/abstract/id.rb

Direct Known Subclasses

Cookie::SessionId

Constant Summary collapse

ID_VERSION =
2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(public_id) ⇒ SessionId

Returns a new instance of SessionId.



26
27
28
# File 'lib/rack/session/abstract/id.rb', line 26

def initialize(public_id)
  @public_id = public_id
end

Instance Attribute Details

#public_idObject (readonly) Also known as: cookie_value, to_s

Returns the value of attribute public_id.



24
25
26
# File 'lib/rack/session/abstract/id.rb', line 24

def public_id
  @public_id
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


37
# File 'lib/rack/session/abstract/id.rb', line 37

def empty?; false; end

#inspectObject



38
# File 'lib/rack/session/abstract/id.rb', line 38

def inspect; public_id.inspect; end

#private_idObject



30
31
32
# File 'lib/rack/session/abstract/id.rb', line 30

def private_id
  "#{ID_VERSION}::#{hash_sid(public_id)}"
end