Class: Booth::Models::Remote
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Booth::Models::Remote
- Defined in:
- lib/booth/models/remote.rb
Overview
Login remotely by entering a code in the browser of an existing session.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.lifespan ⇒ Object
23 24 25 |
# File 'lib/booth/models/remote.rb', line 23 def self.lifespan ::Booth.config.interaction_timeout end |
Instance Method Details
#formatted_code ⇒ Object
27 28 29 |
# File 'lib/booth/models/remote.rb', line 27 def formatted_code code.to_s.scan(/.{1,3}/).join(' ').presence end |
#recently_created? ⇒ Boolean
31 32 33 |
# File 'lib/booth/models/remote.rb', line 31 def recently_created? ::Booth::Models::Remotes::Scopes::RecentlyCreated.call(self) end |
#recently_responded? ⇒ Boolean
35 36 37 |
# File 'lib/booth/models/remote.rb', line 35 def recently_responded? ::Booth::Models::Remotes::Scopes::RecentlyResponded.call(self) end |