Class: Coverfield::Source::Method
- Inherits:
-
Object
- Object
- Coverfield::Source::Method
- Defined in:
- lib/coverfield/source/method.rb
Overview
Represents a method within a class
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source_class ⇒ Object
readonly
Returns the value of attribute source_class.
Instance Method Summary collapse
-
#initialize(method_name, args, body, source_class) ⇒ Method
constructor
Constructor.
-
#nocov? ⇒ Boolean
Tells whether the method should be covered by a test or not.
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
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/coverfield/source/method.rb', line 3 def args @args end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/coverfield/source/method.rb', line 3 def body @body end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/coverfield/source/method.rb', line 3 def name @name end |
#source_class ⇒ Object (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
15 16 17 |
# File 'lib/coverfield/source/method.rb', line 15 public def nocov? @source_class.source_file.nocov? @body end |