Class: TestParser::SnippetSource::Method

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/test_parser/snippet_source/method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Common

#source_code

Constructor Details

#initialize(file, method_name) ⇒ Method

Returns a new instance of Method.



11
12
13
# File 'lib/test_parser/snippet_source/method.rb', line 11

def initialize(file, method_name)
  @file, @method_name = file, method_name
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/test_parser/snippet_source/method.rb', line 7

def file
  @file
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



7
8
9
# File 'lib/test_parser/snippet_source/method.rb', line 7

def method_name
  @method_name
end

Instance Method Details

#snippetObject



15
16
17
# File 'lib/test_parser/snippet_source/method.rb', line 15

def snippet
  source_code.extract_method(method_name)
end