Class: Legion::Extensions::Absorbers::Matchers::File

Inherits:
Base
  • Object
show all
Defined in:
lib/legion/extensions/absorbers/matchers/file.rb

Class Method Summary collapse

Methods inherited from Base

for_type, inherited, register

Class Method Details

.match?(pattern, input) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/legion/extensions/absorbers/matchers/file.rb', line 10

def self.match?(pattern, input)
  return false unless input.is_a?(::String)

  ::File.fnmatch(pattern, input, ::File::FNM_PATHNAME | ::File::FNM_DOTMATCH)
end

.typeObject



16
17
18
# File 'lib/legion/extensions/absorbers/matchers/file.rb', line 16

def self.type
  :file
end