Class: Saxerator::Latches::ForTags
- Inherits:
-
AbstractLatch
- Object
- SaxHandler
- AbstractLatch
- Saxerator::Latches::ForTags
- Defined in:
- lib/saxerator/latches/for_tags.rb
Instance Method Summary collapse
- #end_element(name) ⇒ Object
-
#initialize(names) ⇒ ForTags
constructor
A new instance of ForTags.
- #start_element(name, _) ⇒ Object
Methods inherited from AbstractLatch
Methods inherited from SaxHandler
Constructor Details
#initialize(names) ⇒ ForTags
Returns a new instance of ForTags.
6 7 8 |
# File 'lib/saxerator/latches/for_tags.rb', line 6 def initialize(names) @names = names end |
Instance Method Details
#end_element(name) ⇒ Object
14 15 16 |
# File 'lib/saxerator/latches/for_tags.rb', line 14 def end_element(name) close if @names.include?(name) end |
#start_element(name, _) ⇒ Object
10 11 12 |
# File 'lib/saxerator/latches/for_tags.rb', line 10 def start_element(name, _) @names.include?(name) ? open : close end |