Class: Rounders::Matchers::Filename
- Defined in:
- lib/rounders/matchers/filename.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Attributes inherited from Matcher
Instance Method Summary collapse
-
#initialize(pattern) ⇒ Filename
constructor
A new instance of Filename.
- #match(message) ⇒ Object
Methods inherited from Matcher
Methods included from Plugins::Pluggable
Constructor Details
#initialize(pattern) ⇒ Filename
Returns a new instance of Filename.
6 7 8 |
# File 'lib/rounders/matchers/filename.rb', line 6 def initialize(pattern) @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
4 5 6 |
# File 'lib/rounders/matchers/filename.rb', line 4 def pattern @pattern end |
Instance Method Details
#match(message) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/rounders/matchers/filename.rb', line 10 def match() return if . matches = ..map do || match = .filename.match(pattern) match.nil? ? nil : end matches.compact end |