Class: Hashira::Focus

Inherits:
Object
  • Object
show all
Defined in:
lib/hashira/focus.rb

Constant Summary collapse

SITE =
/\A(?<path>[^\s:]+\.rb):/

Instance Method Summary collapse

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

Returns:

  • (Boolean)


11
# File 'lib/hashira/focus.rb', line 11

def narrowing? = !@paths.empty?