Class: Querly::Pattern::Expr::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/querly/pattern/expr.rb

Direct Known Subclasses

Any, Constant, Dstr, Ivar, Literal, Nil, Not, Send, Vcall

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



13
14
15
# File 'lib/querly/pattern/expr.rb', line 13

def ==(other)
  other.class == self.class && other.attributes == attributes
end

#=~(pair) ⇒ Object



5
6
7
# File 'lib/querly/pattern/expr.rb', line 5

def =~(pair)
  test_node(pair.node)
end

#attributesObject



17
18
19
20
21
# File 'lib/querly/pattern/expr.rb', line 17

def attributes
  instance_variables.each.with_object({}) do |name, hash|
    hash[name] = instance_variable_get(name)
  end
end

#test_node(node) ⇒ Object



9
10
11
# File 'lib/querly/pattern/expr.rb', line 9

def test_node(node)
  false
end