Class: Coverband::Utils::MethodDefinitionScanner

Inherits:
Object
  • Object
show all
Defined in:
lib/coverband/utils/method_definition_scanner.rb

Defined Under Namespace

Classes: MethodBody, MethodDefinition

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ MethodDefinitionScanner

Returns a new instance of MethodDefinitionScanner.



9
10
11
# File 'lib/coverband/utils/method_definition_scanner.rb', line 9

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/coverband/utils/method_definition_scanner.rb', line 7

def path
  @path
end

Class Method Details

.scan(path) ⇒ Object



17
18
19
# File 'lib/coverband/utils/method_definition_scanner.rb', line 17

def self.scan(path)
  new(path).scan
end

Instance Method Details

#scanObject



13
14
15
# File 'lib/coverband/utils/method_definition_scanner.rb', line 13

def scan
  scan_node(RubyVM::AbstractSyntaxTree.parse_file(path), nil)
end