Class: Tzispa::Helpers::SessionAuth::Authentication
- Inherits:
-
Object
- Object
- Tzispa::Helpers::SessionAuth::Authentication
- Defined in:
- lib/tzispa/helpers/session_auth.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id, secret) ⇒ Authentication
constructor
A new instance of Authentication.
- #valid?(secret) ⇒ Boolean
Constructor Details
#initialize(id, secret) ⇒ Authentication
Returns a new instance of Authentication.
14 15 16 17 |
# File 'lib/tzispa/helpers/session_auth.rb', line 14 def initialize(id, secret) @id = id @token = generate_token secret end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/tzispa/helpers/session_auth.rb', line 12 def id @id end |
Instance Method Details
#valid?(secret) ⇒ Boolean
19 20 21 |
# File 'lib/tzispa/helpers/session_auth.rb', line 19 def valid?(secret) @token == generate_token(secret) end |