| Class | REXML::Validation::Event |
| In: |
lib/rexml/validation/validation.rb
|
| Parent: | Object |
| event_arg | [RW] | |
| event_type | [R] |
# File lib/rexml/validation/validation.rb, line 80
80: def initialize(event_type, event_arg=nil )
81: @event_type = event_type
82: @event_arg = event_arg
83: end
# File lib/rexml/validation/validation.rb, line 141
141: def ==( other )
142: return false unless other.kind_of? Event
143: @event_type == other.event_type and @event_arg == other.event_arg
144: end
# File lib/rexml/validation/validation.rb, line 150
150: def inspect
151: "#{@event_type.inspect}( #@event_arg )"
152: end
# File lib/rexml/validation/validation.rb, line 96
96: def matches?( event )
97: #puts "#@event_type =? #{event[0]} && #@event_arg =? #{event[1]} "
98: return false unless event[0] == @event_type
99: case event[0]
100: when nil
101: return true
102: when :start_element
103: return true if event[1] == @event_arg
104: when :end_element
105: return true
106: when :start_attribute
107: return true if event[1] == @event_arg
108: when :end_attribute
109: return true
110: when :end_document
111: return true
112: when :text
113: return (@event_arg.nil? or @event_arg == event[1])
114: ??
115: else
116: false
117: end
118: end