Class: ParsingNesting::Tree::MandatoryClause
- Defined in:
- lib/parsing_nesting/tree.rb
Instance Attribute Summary collapse
-
#operand ⇒ Object
Returns the value of attribute operand.
Instance Method Summary collapse
- #can_embed? ⇒ Boolean
-
#initialize(v) ⇒ MandatoryClause
constructor
A new instance of MandatoryClause.
-
#negate ⇒ Object
negating mandatory to excluded is decent semantics, although it’s not strictly ‘true’, it’s a choice.
- #to_embed ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(v) ⇒ MandatoryClause
Returns a new instance of MandatoryClause.
356 357 358 |
# File 'lib/parsing_nesting/tree.rb', line 356 def initialize(v) self.operand = v end |
Instance Attribute Details
#operand ⇒ Object
Returns the value of attribute operand.
355 356 357 |
# File 'lib/parsing_nesting/tree.rb', line 355 def operand @operand end |
Instance Method Details
#can_embed? ⇒ Boolean
360 361 362 363 364 |
# File 'lib/parsing_nesting/tree.rb', line 360 def # right now '+' clauses only apply to terms/phrases # which we can embed with a + in front. true end |
#negate ⇒ Object
negating mandatory to excluded is decent semantics, although it’s not strictly ‘true’, it’s a choice.
372 373 374 |
# File 'lib/parsing_nesting/tree.rb', line 372 def negate ExcludedClause.new(operand) end |
#to_embed ⇒ Object
366 367 368 |
# File 'lib/parsing_nesting/tree.rb', line 366 def '+' + operand. end |