Class FileType
In: P4Triggers.rb
Parent: Object

A class for encapsulating file types - type checking is quite common in many triggers so it’s nice to have it available to all.

Methods
match    new   
Attributes
msg  [R] 
Public Class methods
new( regexp, message )

Provide a regexp that the filetype must match and a message for the types that match the regexp. i.e.

  FileType.new( /u?binary/, "binary/ubinary" )
# File P4Triggers.rb, line 109
    def initialize( regexp, message )
        @re    = regexp
        @msg   = message
    end
Public Instance methods
match( type )

Test to see if the given filetype matches this type using the regexp.

# File P4Triggers.rb, line 118
    def match( type )
        @re.match( type ) 
    end