module Arel::Ltree::MatchesPredications

Public Instance Methods

lquery(other) click to toggle source
# File lib/arel-ltree/ltree/predications.rb, line 25
def lquery(other)
  ltree_matches_node(other, Attributes::Lquery)
end
ltree(other) click to toggle source
# File lib/arel-ltree/ltree/predications.rb, line 29
def ltree(other)
  ltree_matches_node(other, Attributes::Ltree)
end

Private Instance Methods

ltree_matches_node(other, rop_node_klass) click to toggle source
# File lib/arel-ltree/ltree/predications.rb, line 35
def ltree_matches_node(other, rop_node_klass)
  case other
  when String
    Arel::Ltree::Nodes::Matches.new(self.left, rop_node_klass.new(other))
  when Array
    Arel::Ltree::Nodes::Matches.new(self.left, other.map { |o| rop_node_klass.new(o) })
  else
    Arel::Ltree::Nodes::Matches.new(self.left, other)
  end
end