Class REXML::Validation::Event
In: 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 rexml/validation/validation.rb, line 80
      def initialize(event_type, event_arg=nil )
        @event_type = event_type
        @event_arg = event_arg
      end

Public Instance methods

[Source]

# File rexml/validation/validation.rb, line 141
      def ==( other )
        return false unless other.kind_of? Event
        @event_type == other.event_type and @event_arg == other.event_arg
      end

[Source]

# File rexml/validation/validation.rb, line 88
      def done?
        @done
      end

[Source]

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

[Source]

# File rexml/validation/validation.rb, line 96
      def matches?( event )
        #puts "#@event_type =? #{event[0]} && #@event_arg =? #{event[1]} "
        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

[Source]

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

[Source]

# File rexml/validation/validation.rb, line 146
      def to_s
        inspect
      end

[Validate]