Class: FileGlob
- Inherits:
-
Object
- Object
- FileGlob
- Defined in:
- lib/file_glob.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
- #=~(path) ⇒ Object
-
#initialize(pattern) ⇒ FileGlob
constructor
A new instance of FileGlob.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(pattern) ⇒ FileGlob
Returns a new instance of FileGlob.
4 5 6 |
# File 'lib/file_glob.rb', line 4 def initialize(pattern) @pattern = pattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
2 3 4 |
# File 'lib/file_glob.rb', line 2 def pattern @pattern end |
Instance Method Details
#=~(path) ⇒ Object
8 9 10 |
# File 'lib/file_glob.rb', line 8 def =~ path File.fnmatch?(pattern, path) end |
#inspect ⇒ Object
16 17 18 |
# File 'lib/file_glob.rb', line 16 def inspect "<#FileGlob #{pattern}>" end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/file_glob.rb', line 12 def to_s pattern end |