Class: Mutineer::Project::SubjectVisitor::WrittenName
- Inherits:
-
String
- Object
- String
- Mutineer::Project::SubjectVisitor::WrittenName
- Defined in:
- lib/mutineer/project.rb
Overview
A name that reads like a constant name but may not be one (#216). It is
the singleton class name of a class << self opened inside a def or a
block that does not build a class, or built on a written path or
#<anonymous> (#<Class:Foo::X> from class Foo::X inside class << self);
or the X of module self::X or self::X = ... in a def or a block. The segment carries that mark (see
#singleton_name, #with_namespace, #assigned_owner), and scope, the
def or block whose self the name is under, or a new object when unknown.
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
The def or block node whose
selfthe name is under.
Instance Method Summary collapse
-
#initialize(name, scope = Object.new) ⇒ WrittenName
constructor
A new instance of WrittenName.
Constructor Details
#initialize(name, scope = Object.new) ⇒ WrittenName
Returns a new instance of WrittenName.
193 194 195 196 |
# File 'lib/mutineer/project.rb', line 193 def initialize(name, scope = Object.new) super(name) @scope = scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the def or block node whose self the name is under.
189 190 191 |
# File 'lib/mutineer/project.rb', line 189 def scope @scope end |