diff --git a/lib/oga/css/parser.rll b/lib/oga/css/parser.rll index 1b22ae4..83d9651 100644 --- a/lib/oga/css/parser.rll +++ b/lib/oga/css/parser.rll @@ -668,7 +668,7 @@ even # @return [TrueClass|FalseClass] # def int_node?(node) - return node.type == :int + return node.type.equal?(:int) end ## diff --git a/lib/oga/xml/document.rb b/lib/oga/xml/document.rb index 053b67d..79143e9 100644 --- a/lib/oga/xml/document.rb +++ b/lib/oga/xml/document.rb @@ -83,7 +83,7 @@ module Oga # @return [TrueClass|FalseClass] # def html? - return type == :html + return type.equal?(:html) end ## diff --git a/lib/oga/xpath/evaluator.rb b/lib/oga/xpath/evaluator.rb index 39d06c7..0e9a40c 100644 --- a/lib/oga/xpath/evaluator.rb +++ b/lib/oga/xpath/evaluator.rb @@ -1640,7 +1640,7 @@ module Oga def node_matches?(xml_node, ast_node) ns, name = *ast_node.children - if ast_node.type == :type_test + if ast_node.type.equal?(:type_test) return type_matches?(xml_node, ast_node) end diff --git a/lib/oga/xpath/parser.rll b/lib/oga/xpath/parser.rll index 9aa6b65..4b97f3e 100644 --- a/lib/oga/xpath/parser.rll +++ b/lib/oga/xpath/parser.rll @@ -134,7 +134,7 @@ path_step args = val[1][1] pred = val[1][2] - if type == :test + if type.equal?(:test) # Whenever a bare test is used (e.g. just "A") this actually means # "child::A". Handling this on parser level is the easiest. if args