Class | Ohcount::Gestalt::FilenameRule
In: | lib/gestalt/rules/filename_rule.rb
Parent: | FileRule

rule based a the name of the file

### Methods

new regex trigger_file?

### Attributes

filenames | [R] |

### Public Class methods

new(*args)

[Source]

    # File lib/gestalt/rules/filename_rule.rb, line 7
                            def initialize(*args)
                                    options = args.pop if args.last.is_a?(Hash)
                                    @filenames = args
                                    super(options)
                            end

### Public Instance methods

regex()

[Source]

    # File lib/gestalt/rules/filename_rule.rb, line 17
                            def regex
                                    @regex ||= begin
                                            r = filenames.collect { |f| "(" + f + ")"}.join("|")
                                            Regexp.new(r)
                                    end
                            end

trigger_file?(source_file)

[Source]

    # File lib/gestalt/rules/filename_rule.rb, line 13
                            def trigger_file?(source_file)
                                    regex.match(source_file.filename)
                            end

[Validate]