Class: Fried::Test::Directory::GetFilesByPattern
- Inherits:
-
Object
- Object
- Fried::Test::Directory::GetFilesByPattern
- Defined in:
- lib/fried/test/directory/get_files_by_pattern.rb
Overview
Behaves like Dir.glob
Defined Under Namespace
Classes: Substitute
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
28 29 30 |
# File 'lib/fried/test/directory/get_files_by_pattern.rb', line 28 def dir @dir end |
Class Method Details
.build ⇒ Object
30 31 32 33 34 |
# File 'lib/fried/test/directory/get_files_by_pattern.rb', line 30 def self.build new.tap do |instance| instance.dir = Dir end end |
.call ⇒ Object
44 45 46 47 |
# File 'lib/fried/test/directory/get_files_by_pattern.rb', line 44 def self.call instance = build instance.() end |
Instance Method Details
#call(pattern, flags = 0) ⇒ Array<String>
38 39 40 41 42 |
# File 'lib/fried/test/directory/get_files_by_pattern.rb', line 38 def call(pattern, flags = 0) return [] if dir.nil? dir.glob(pattern, flags) end |