Class: Mutineer::Subject
- Inherits:
-
Struct
- Object
- Struct
- Mutineer::Subject
- Defined in:
- lib/mutineer/subject.rb
Overview
One discoverable method and its AST node.
Location, namespace context, and the live Prism::DefNode are kept together because mutators walk the def node directly.
Instance Attribute Summary collapse
-
#def_node ⇒ Object
Returns the value of attribute def_node.
-
#file ⇒ Object
Returns the value of attribute file.
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#singleton ⇒ Object
Returns the value of attribute singleton.
Instance Method Summary collapse
-
#body_loc ⇒ Prism::Location?
Returns the body location for the subject, if any.
-
#qualified_name ⇒ String
Returns the fully-qualified subject name.
Instance Attribute Details
#def_node ⇒ Object
Returns the value of attribute def_node
8 9 10 |
# File 'lib/mutineer/subject.rb', line 8 def def_node @def_node end |
#file ⇒ Object
Returns the value of attribute file
8 9 10 |
# File 'lib/mutineer/subject.rb', line 8 def file @file end |
#name ⇒ Object
Returns the value of attribute name
8 9 10 |
# File 'lib/mutineer/subject.rb', line 8 def name @name end |
#namespace ⇒ Object
Returns the value of attribute namespace
8 9 10 |
# File 'lib/mutineer/subject.rb', line 8 def namespace @namespace end |
#singleton ⇒ Object
Returns the value of attribute singleton
8 9 10 |
# File 'lib/mutineer/subject.rb', line 8 def singleton @singleton end |
Instance Method Details
#body_loc ⇒ Prism::Location?
Returns the body location for the subject, if any.
19 20 21 |
# File 'lib/mutineer/subject.rb', line 19 def body_loc def_node.body&.location end |
#qualified_name ⇒ String
Returns the fully-qualified subject name.
12 13 14 |
# File 'lib/mutineer/subject.rb', line 12 def qualified_name namespace.join("::") + (singleton ? "." : "#") + name.to_s end |