Class: Coverfield::Source::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/coverfield/source/method.rb

Overview

Represents a method within a class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method_name, args, body, source_class) ⇒ Method

Constructor



6
7
8
9
10
11
# File 'lib/coverfield/source/method.rb', line 6

public def initialize(method_name, args, body, source_class)
  @name = method_name
  @args = args
  @body = body
  @source_class = source_class
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



3
4
5
# File 'lib/coverfield/source/method.rb', line 3

def args
  @args
end

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/coverfield/source/method.rb', line 3

def body
  @body
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/coverfield/source/method.rb', line 3

def name
  @name
end

#source_classObject (readonly)

Returns the value of attribute source_class.



3
4
5
# File 'lib/coverfield/source/method.rb', line 3

def source_class
  @source_class
end

Instance Method Details

#nocov?Boolean

Tells whether the method should be covered by a test or not

Returns:

  • (Boolean)


15
16
17
# File 'lib/coverfield/source/method.rb', line 15

public def nocov?
  @source_class.source_file.nocov? @body
end