Class REXML::Validation::Event
In: lib/rexml/validation/validation.rb
Parent: Object

Methods

==   done?   inspect   matches?   new   single?   to_s  

Attributes

event_arg  [RW] 
event_type  [R] 

Public Class methods

[Source]

    # 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

Public Instance methods

[Source]

     # 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

[Source]

    # File lib/rexml/validation/validation.rb, line 88
88:       def done?
89:         @done
90:       end

[Source]

     # File lib/rexml/validation/validation.rb, line 150
150:       def inspect
151:         "#{@event_type.inspect}( #@event_arg )"
152:       end

[Source]

     # 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

[Source]

    # File lib/rexml/validation/validation.rb, line 92
92:       def single?
93:         return (@event_type != :start_element and @event_type != :start_attribute)
94:       end

[Source]

     # File lib/rexml/validation/validation.rb, line 146
146:       def to_s
147:         inspect
148:       end

[Validate]