Class: Hashira::Focus
- Inherits:
-
Object
- Object
- Hashira::Focus
- Defined in:
- lib/hashira/focus.rb
Constant Summary collapse
- SITE =
/\A(?<path>[^\s:]+\.rb):/
Instance Method Summary collapse
-
#initialize(project, paths) ⇒ Focus
constructor
A new instance of Focus.
- #narrow(findings) ⇒ Object
- #narrowing? ⇒ Boolean
Constructor Details
#initialize(project, paths) ⇒ Focus
Returns a new instance of Focus.
6 7 8 9 |
# File 'lib/hashira/focus.rb', line 6 def initialize(project, paths) @project = project @paths = paths end |
Instance Method Details
#narrow(findings) ⇒ Object
13 14 15 16 |
# File 'lib/hashira/focus.rb', line 13 def narrow(findings) return findings unless narrowing? findings.select { named?(it) } end |
#narrowing? ⇒ Boolean
11 |
# File 'lib/hashira/focus.rb', line 11 def narrowing? = !@paths.empty? |