Class: ParsingNesting::Tree::ExcludedClause

Inherits:
Node
  • Object
show all
Defined in:
lib/parsing_nesting/tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#to_query

Constructor Details

#initialize(v) ⇒ ExcludedClause

Returns a new instance of ExcludedClause.



380
381
382
# File 'lib/parsing_nesting/tree.rb', line 380

def initialize(v)
  self.operand = v
end

Instance Attribute Details

#operandObject

Returns the value of attribute operand.



378
379
380
# File 'lib/parsing_nesting/tree.rb', line 378

def operand
  @operand
end

Instance Method Details

#can_embed?Boolean

Returns:

  • (Boolean)


384
385
386
387
388
# File 'lib/parsing_nesting/tree.rb', line 384

def can_embed?
  # right now '-' clauses only apply to terms/phrases, which
  # we can embed with a '-' in front.
  true
end

#negateObject

negating excluded to mandatory is a pretty decent choice



395
396
397
# File 'lib/parsing_nesting/tree.rb', line 395

def negate
  MandatoryClause.new(operand)
end

#simple_pure_negative?Boolean

Returns:

  • (Boolean)


399
400
401
# File 'lib/parsing_nesting/tree.rb', line 399

def simple_pure_negative?
  true
end

#to_embedObject



390
391
392
# File 'lib/parsing_nesting/tree.rb', line 390

def to_embed
  '-' + operand.to_embed
end