Class: Appfuel::Repository::ExprConjunction
- Inherits:
-
Object
- Object
- Appfuel::Repository::ExprConjunction
- Defined in:
- lib/appfuel/storage/repository/expr_conjunction.rb
Constant Summary collapse
- OPERATORS =
['and', 'or'].freeze
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #conjunction? ⇒ Boolean
-
#initialize(type, left, right) ⇒ ExprConjunction
constructor
A new instance of ExprConjunction.
- #qualified? ⇒ Boolean
- #qualify_feature(feature, domain) ⇒ Object
- #qualify_global(domain) ⇒ Object
Constructor Details
#initialize(type, left, right) ⇒ ExprConjunction
Returns a new instance of ExprConjunction.
7 8 9 10 11 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 7 def initialize(type, left, right) @op = validate_operator(type) @left = left @right = right end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
5 6 7 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 5 def left @left end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
5 6 7 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 5 def op @op end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
5 6 7 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 5 def right @right end |
Instance Method Details
#conjunction? ⇒ Boolean
13 14 15 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 13 def conjunction? true end |
#qualified? ⇒ Boolean
17 18 19 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 17 def qualified? left.qualified? && right.qualified? end |
#qualify_feature(feature, domain) ⇒ Object
21 22 23 24 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 21 def qualify_feature(feature, domain) left.qualify_feature(feature, domain) unless left.qualified? right.qualify_feature(feature, domain) unless right.qualified? end |
#qualify_global(domain) ⇒ Object
26 27 28 29 |
# File 'lib/appfuel/storage/repository/expr_conjunction.rb', line 26 def qualify_global(domain) left.qualify_global(domain) unless left.qualified? right.qualify_global(domain) unless right.qualified? end |