==( other )
click to toggle source
def ==( other )
return false unless other.kind_of? Event
@event_type == other.event_type and @event_arg == other.event_arg
end
done?()
click to toggle source
inspect()
click to toggle source
def inspect
"#{@event_type.inspect}( #@event_arg )"
end
matches?( event )
click to toggle source
def matches?( event )
return false unless event[0] == @event_type
case event[0]
when nil
return true
when :start_element
return true if event[1] == @event_arg
when :end_element
return true
when :start_attribute
return true if event[1] == @event_arg
when :end_attribute
return true
when :end_document
return true
when :text
return (@event_arg.nil? or @event_arg == event[1])
else
false
end
end
single?()
click to toggle source
def single?
return (@event_type != :start_element and @event_type != :start_attribute)
end
to_s()
click to toggle source