Class: Minitest::Filesystem::Matcher::MatchingTree
- Inherits:
-
Object
- Object
- Minitest::Filesystem::Matcher::MatchingTree
- Defined in:
- lib/minitest/filesystem/matcher.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #expand_path(file) ⇒ Object
- #include?(entry) ⇒ Boolean
-
#initialize(root) ⇒ MatchingTree
constructor
A new instance of MatchingTree.
- #is_a?(entry, kind) ⇒ Boolean
Constructor Details
#initialize(root) ⇒ MatchingTree
Returns a new instance of MatchingTree.
91 92 93 94 |
# File 'lib/minitest/filesystem/matcher.rb', line 91 def initialize(root) @root = Pathname.new(root) @tree = @root end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
89 90 91 |
# File 'lib/minitest/filesystem/matcher.rb', line 89 def root @root end |
Instance Method Details
#expand_path(file) ⇒ Object
104 105 106 |
# File 'lib/minitest/filesystem/matcher.rb', line 104 def (file) @root + Pathname.new(file) end |
#include?(entry) ⇒ Boolean
96 97 98 |
# File 'lib/minitest/filesystem/matcher.rb', line 96 def include?(entry) @tree.include?((entry)) end |
#is_a?(entry, kind) ⇒ Boolean
100 101 102 |
# File 'lib/minitest/filesystem/matcher.rb', line 100 def is_a?(entry, kind) ( entry).send("#{kind}?") end |