Class: Smartdown::Model::Predicate::AndOperation
- Inherits:
-
Struct
- Object
- Struct
- Smartdown::Model::Predicate::AndOperation
- Defined in:
- lib/smartdown/model/predicate/and_operation.rb
Instance Attribute Summary collapse
-
#predicates ⇒ Object
Returns the value of attribute predicates.
Instance Method Summary collapse
Instance Attribute Details
#predicates ⇒ Object
Returns the value of attribute predicates
4 5 6 |
# File 'lib/smartdown/model/predicate/and_operation.rb', line 4 def predicates @predicates end |
Instance Method Details
#evaluate(state) ⇒ Object
5 6 7 |
# File 'lib/smartdown/model/predicate/and_operation.rb', line 5 def evaluate(state) predicates.map { |predicate| predicate.evaluate(state) }.all? end |
#humanize ⇒ Object
9 10 11 |
# File 'lib/smartdown/model/predicate/and_operation.rb', line 9 def humanize "(#{predicates.map { |p| p.humanize }.join(' AND ')})" end |