Module: Arel::Ltree::Predications

Included in:
Attributes::Ltree
Defined in:
lib/arel-ltree/ltree/predications.rb

Instance Method Summary collapse

Instance Method Details

#ancestor_of(other) ⇒ Object



4
5
6
# File 'lib/arel-ltree/ltree/predications.rb', line 4

def ancestor_of(other)
  Arel::Ltree::Nodes::AncestorOf.new(self, other)
end

#descendant_of(other) ⇒ Object



8
9
10
# File 'lib/arel-ltree/ltree/predications.rb', line 8

def descendant_of(other)
  Arel::Ltree::Nodes::DescendantOf.new(self, other)
end

#matches(*args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/arel-ltree/ltree/predications.rb', line 12

def matches(*args)
  case args[0]
  when Attributes::Lquery, Attributes::Ltree
    Arel::Ltree::Nodes::Matches.new(self, args[0])
  when nil
    Arel::Ltree::Nodes::Matches.new(self)
  else
    super
  end
end