Module: Classifile::NameChecker
- Included in:
- State
- Defined in:
- lib/classifile/checker/name_checker.rb
Overview
Check the file name
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#end_with?(*patterns) ⇒ Boolean
Whether the file name ends with one of the target strings.
-
#include?(*patterns) ⇒ Boolean
Whether the file name contains any of the target string.
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/classifile/checker/name_checker.rb', line 7 def name @name end |
Instance Method Details
#end_with?(*patterns) ⇒ Boolean
Whether the file name ends with one of the target strings
20 21 22 23 24 25 |
# File 'lib/classifile/checker/name_checker.rb', line 20 def end_with?(*patterns) patterns.each do |p| return nil if _end_with?(p) end raise Failed unless @gotcha end |
#include?(*patterns) ⇒ Boolean
Whether the file name contains any of the target string
11 12 13 14 15 16 |
# File 'lib/classifile/checker/name_checker.rb', line 11 def include?(*patterns) patterns.each do |p| return nil if _include?(p) end raise Failed unless @gotcha end |