Class: Ask::State::Lock

Inherits:
Data
  • Object
show all
Defined in:
lib/ask/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expires_atObject (readonly)

Returns the value of attribute expires_at

Returns:

  • (Object)

    the current value of expires_at



35
36
37
# File 'lib/ask/state.rb', line 35

def expires_at
  @expires_at
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



35
36
37
# File 'lib/ask/state.rb', line 35

def id
  @id
end

#tokenObject (readonly)

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



35
36
37
# File 'lib/ask/state.rb', line 35

def token
  @token
end

Instance Method Details

#expired?(now = Time.now) ⇒ Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ask/state.rb', line 36

def expired?(now = Time.now)
  expires_at && now >= expires_at
end