class InterMine::PathQuery::LogicGroup

Attributes

left[R]
op[R]
parent[RW]
right[R]

Public Class Methods

new(left, op, right, parent=nil) click to toggle source
     # File lib/intermine/query.rb
1435 def initialize(left, op, right, parent=nil)
1436     if !["AND", "OR"].include?(op)
1437         raise ArgumentError, "#{op} is not a legal logical operator"
1438     end
1439     @parent = parent
1440     @left = left
1441     @op = op
1442     @right = right
1443     [left, right].each do |node|
1444         if node.is_a?(LogicGroup)
1445             node.parent = self
1446         end
1447     end
1448 end

Public Instance Methods

code() click to toggle source
     # File lib/intermine/query.rb
1459 def code
1460     return to_s
1461 end
to_s() click to toggle source
     # File lib/intermine/query.rb
1450 def to_s
1451     core = [@left.code, @op.downcase, @right.code].join(" ")
1452     if @parent && @op != @parent.op
1453         return "(#{core})"
1454     else
1455         return core
1456     end
1457 end