Class: Gammo::CSSSelector::AST::Selector::Attrib::Includes

Inherits:
Gammo::CSSSelector::AST::Selector::Attrib show all
Defined in:
lib/gammo/css_selector/ast/selector/attrib_selector.rb

Constant Summary

Constants included from Subclassify

Subclassify::NotFoundError

Instance Attribute Summary

Attributes inherited from Gammo::CSSSelector::AST::Selector::Attrib

#value

Instance Method Summary collapse

Methods inherited from Gammo::CSSSelector::AST::Selector::Attrib

#initialize

Constructor Details

This class inherits a constructor from Gammo::CSSSelector::AST::Selector::Attrib

Instance Method Details

#match?(context) ⇒ Boolean

Returns:

  • (Boolean)


76
77
78
79
80
# File 'lib/gammo/css_selector/ast/selector/attrib_selector.rb', line 76

def match?(context)
  return false if !@value || @value.empty?
  val = attrib_value(context.node) || ''
  val == @value || (val.split(/\s/).include?(@value))
end