Class: Leftovers::Matchers::NodeName
- Inherits:
-
Object
- Object
- Leftovers::Matchers::NodeName
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/matchers/node_name.rb
Instance Attribute Summary collapse
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
Instance Method Summary collapse
- #===(node) ⇒ Object
-
#initialize(matcher) ⇒ NodeName
constructor
A new instance of NodeName.
Methods included from ComparableInstance
Constructor Details
#initialize(matcher) ⇒ NodeName
Returns a new instance of NodeName.
10 11 12 13 14 |
# File 'lib/leftovers/matchers/node_name.rb', line 10 def initialize(matcher) @matcher = matcher freeze end |
Instance Attribute Details
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
8 9 10 |
# File 'lib/leftovers/matchers/node_name.rb', line 8 def matcher @matcher end |
Instance Method Details
#===(node) ⇒ Object
16 17 18 19 20 |
# File 'lib/leftovers/matchers/node_name.rb', line 16 def ===(node) name = node.name @matcher === name if name end |