Type-Safe Sessions
Defining a Session
class UserSession < Session::Base
property? authenticated : Bool = false
property user_id : Int64? = nil
property username : String? = nil
property role : String = "guest"
endclass UserSession < Session::Base
property user_id : Int64? = nil
def authenticated? : Bool
!user_id.nil?
end
endBuilt-in Properties
Property
Type
Default
Description
Built-in Methods
Method
Return
Description
JSON Serialization
Generic Type System
See Also
Last updated
Was this helpful?