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



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

def expires_at
  @expires_at
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



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

def id
  @id
end

#tokenObject (readonly)

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



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

def token
  @token
end

Instance Method Details

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

Returns:

  • (Boolean)


38
39
40
# File 'lib/ask/state.rb', line 38

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