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

Inherits:
Object
  • Object
show all
Defined in:
lib/gammo/css_selector/ast/selector/attrib_selector.rb

Defined Under Namespace

Classes: DashMatch, Equal, Includes, PrefixMatch, SubstringMatch, SuffixMatch

Constant Summary

Constants included from Subclassify

Subclassify::NotFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, value:, namespace_prefix: nil) ⇒ Attrib

Returns a new instance of Attrib.



10
11
12
13
14
# File 'lib/gammo/css_selector/ast/selector/attrib_selector.rb', line 10

def initialize(key:, value:, namespace_prefix: nil)
  @key = key
  @value = value
  @namespace_prefix = namespace_prefix
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



6
7
8
# File 'lib/gammo/css_selector/ast/selector/attrib_selector.rb', line 6

def value
  @value
end

Instance Method Details

#match?(context) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplemented)


16
17
18
# File 'lib/gammo/css_selector/ast/selector/attrib_selector.rb', line 16

def match?(context)
  raise NotImplemented, "#match? must be implemented by sub class"
end