Class: Ruby::Merge::NocovWrapperBase
- Inherits:
-
Object
- Object
- Ruby::Merge::NocovWrapperBase
show all
- Includes:
- Ast::Merge::BlockDirective
- Defined in:
- lib/ruby/merge/nocov_wrapper_base.rb
Overview
Shared Ruby wrapper for nodes carrying unbalanced or inline nocov markers.
The wrapped parser node remains responsible for structural identity; this
wrapper only marks it as a Ruby coverage directive participant.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(node, merge_type = :nocov) ⇒ NocovWrapperBase
Returns a new instance of NocovWrapperBase.
14
15
16
17
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 14
def initialize(node, merge_type = :nocov)
@node = node
@merge_type = merge_type
end
|
Instance Attribute Details
#merge_type ⇒ Object
Returns the value of attribute merge_type.
12
13
14
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 12
def merge_type
@merge_type
end
|
#node ⇒ Object
Returns the value of attribute node.
12
13
14
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 12
def node
@node
end
|
Instance Method Details
#block_directive? ⇒ Boolean
39
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 39
def block_directive? = true
|
#children ⇒ Object
20
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 20
def children = []
|
#end_line ⇒ Object
27
28
29
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 27
def end_line
@node.location&.end_line
end
|
#inspect ⇒ Object
41
42
43
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 41
def inspect
"#<#{self.class} merge_type=#{@merge_type.inspect} node=#{@node.inspect}>"
end
|
#kind ⇒ Object
19
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 19
def kind = :nocov
|
#location ⇒ Object
33
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 33
def location = @node.location
|
#merge_policy ⇒ Object
21
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 21
def merge_policy = nil
|
#nocov_node? ⇒ Boolean
38
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 38
def nocov_node? = false
|
#nocov_wrapper? ⇒ Boolean
37
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 37
def nocov_wrapper? = true
|
#slice ⇒ Object
35
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 35
def slice = @node.slice
|
#start_line ⇒ Object
23
24
25
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 23
def start_line
@node.location&.start_line
end
|
#unwrap ⇒ Object
31
|
# File 'lib/ruby/merge/nocov_wrapper_base.rb', line 31
def unwrap = @node
|