class Saxerator::Latches::Within
Public Class Methods
new(name)
click to toggle source
# File lib/saxerator/latches/within.rb, line 4 def initialize(name) @name = name @depth_within_element = 0 end
Public Instance Methods
end_element(_)
click to toggle source
# File lib/saxerator/latches/within.rb, line 13 def end_element(_) @depth_within_element -= 1 if @depth_within_element > 0 end
open?()
click to toggle source
# File lib/saxerator/latches/within.rb, line 17 def open? @depth_within_element > 1 end
start_element(name, _)
click to toggle source
# File lib/saxerator/latches/within.rb, line 9 def start_element(name, _) @depth_within_element += 1 if name == @name || @depth_within_element > 0 end