Class: Jumbotron::Adapters::PolicyDefinition
- Inherits:
-
Data
- Object
- Data
- Jumbotron::Adapters::PolicyDefinition
- Defined in:
- app/adapters/jumbotron/adapters/policy_definition.rb
Overview
Frozen registry entry for one adapter-declared update policy. Not a Policy base class.
Instance Attribute Summary collapse
-
#cadence ⇒ Object
readonly
Returns the value of attribute cadence.
-
#eligible ⇒ Object
readonly
Returns the value of attribute eligible.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#cadence ⇒ Object (readonly)
Returns the value of attribute cadence
6 7 8 |
# File 'app/adapters/jumbotron/adapters/policy_definition.rb', line 6 def cadence @cadence end |
#eligible ⇒ Object (readonly)
Returns the value of attribute eligible
6 7 8 |
# File 'app/adapters/jumbotron/adapters/policy_definition.rb', line 6 def eligible @eligible end |
#id ⇒ Object (readonly)
Returns the value of attribute id
6 7 8 |
# File 'app/adapters/jumbotron/adapters/policy_definition.rb', line 6 def id @id end |
#type ⇒ Object (readonly)
Returns the value of attribute type
6 7 8 |
# File 'app/adapters/jumbotron/adapters/policy_definition.rb', line 6 def type @type end |
Instance Method Details
#eligible?(game, now:) ⇒ Boolean
7 8 9 10 11 |
# File 'app/adapters/jumbotron/adapters/policy_definition.rb', line 7 def eligible?(game, now:) raise ::Jumbotron::Adapters::ConfigurationError, "policy #{id} has no eligible predicate" if eligible.nil? eligible.call(game, now: now) end |