Class: RoadForest::SourceRigor::Credence::NoneIfRoleAbsent
- Inherits:
-
Object
- Object
- RoadForest::SourceRigor::Credence::NoneIfRoleAbsent
- Defined in:
- lib/roadforest/source-rigor/credence/none-if-role-absent.rb
Overview
Unless we have results for the subject context, nothing is valid
Instance Attribute Summary collapse
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
- #credible(contexts, results) ⇒ Object
-
#initialize(role) ⇒ NoneIfRoleAbsent
constructor
A new instance of NoneIfRoleAbsent.
Constructor Details
#initialize(role) ⇒ NoneIfRoleAbsent
Returns a new instance of NoneIfRoleAbsent.
5 6 7 |
# File 'lib/roadforest/source-rigor/credence/none-if-role-absent.rb', line 5 def initialize(role) @role = role end |
Instance Attribute Details
#role ⇒ Object (readonly)
Returns the value of attribute role.
8 9 10 |
# File 'lib/roadforest/source-rigor/credence/none-if-role-absent.rb', line 8 def role @role end |
Instance Method Details
#credible(contexts, results) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/roadforest/source-rigor/credence/none-if-role-absent.rb', line 10 def credible(contexts, results) if contexts.include?(results.context_roles[role]) contexts else [] end end |