Class: Booth::Models::Contest
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Booth::Models::Contest
- Defined in:
- lib/booth/models/contest.rb
Class Method Summary collapse
Instance Method Summary collapse
- #formatted_code ⇒ Object
- #lifespan ⇒ Object
- #recently_created? ⇒ Boolean
- #recently_responded? ⇒ Boolean
Class Method Details
.lifespan ⇒ Object
20 21 22 |
# File 'lib/booth/models/contest.rb', line 20 def self.lifespan ::Booth.config.interaction_timeout end |
Instance Method Details
#formatted_code ⇒ Object
24 25 26 |
# File 'lib/booth/models/contest.rb', line 24 def formatted_code code.to_s.scan(/.{1,3}/).join(' ').presence end |
#lifespan ⇒ Object
36 37 38 |
# File 'lib/booth/models/contest.rb', line 36 def lifespan self.class.lifespan end |