Class: SimpleCov::Formatter::AIFormatter::ASTResolver::SemanticNode
- Inherits:
-
Object
- Object
- SimpleCov::Formatter::AIFormatter::ASTResolver::SemanticNode
- Extended by:
- T::Sig
- Defined in:
- lib/simplecov-ai/ast_resolver/semantic_node.rb
Overview
An immutable struct housing bounds, identification metrics, and static bypassing definitions derived from traversing the AST nodes.
Instance Attribute Summary collapse
-
#bypass_reasons ⇒ Object
readonly
Returns the value of attribute bypass_reasons.
-
#end_line ⇒ Object
readonly
Returns the value of attribute end_line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#start_line ⇒ Object
readonly
Returns the value of attribute start_line.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #add_bypass(bypass_reason) ⇒ Object
-
#initialize(name:, type:, start_line:, end_line:, bypass_reasons: []) ⇒ SemanticNode
constructor
A new instance of SemanticNode.
Constructor Details
#initialize(name:, type:, start_line:, end_line:, bypass_reasons: []) ⇒ SemanticNode
Returns a new instance of SemanticNode.
31 32 33 34 35 36 37 |
# File 'lib/simplecov-ai/ast_resolver/semantic_node.rb', line 31 def initialize(name:, type:, start_line:, end_line:, bypass_reasons: []) @name = name @type = type @start_line = start_line @end_line = end_line @bypass_reasons = bypass_reasons end |
Instance Attribute Details
#bypass_reasons ⇒ Object (readonly)
Returns the value of attribute bypass_reasons.
20 21 22 |
# File 'lib/simplecov-ai/ast_resolver/semantic_node.rb', line 20 def bypass_reasons @bypass_reasons end |
#end_line ⇒ Object (readonly)
Returns the value of attribute end_line.
17 18 19 |
# File 'lib/simplecov-ai/ast_resolver/semantic_node.rb', line 17 def end_line @end_line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/simplecov-ai/ast_resolver/semantic_node.rb', line 14 def name @name end |
#start_line ⇒ Object (readonly)
Returns the value of attribute start_line.
17 18 19 |
# File 'lib/simplecov-ai/ast_resolver/semantic_node.rb', line 17 def start_line @start_line end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'lib/simplecov-ai/ast_resolver/semantic_node.rb', line 14 def type @type end |
Instance Method Details
#add_bypass(bypass_reason) ⇒ Object
40 41 42 |
# File 'lib/simplecov-ai/ast_resolver/semantic_node.rb', line 40 def add_bypass(bypass_reason) @bypass_reasons << bypass_reason end |