Class: LibRubyParser::Nodes::Const
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Const
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents constant access (i.e. Foo::Bar)
Instance Attribute Summary collapse
-
#double_colon_l ⇒ Loc?
readonly
Location of the
::operator. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#name ⇒ String
readonly
Name of the constant, ‘String(“Foo”)` for
Foo. -
#name_l ⇒ Loc
readonly
Location of the constant name.
-
#scope ⇒ Node?
readonly
Scope where the constant is taken from: 1.
Instance Attribute Details
#double_colon_l ⇒ Loc? (readonly)
Location of the :: operator. None if constant is taken from the current scope.
“‘text A::B
~~
“‘
798 799 800 |
# File 'lib/lib-ruby-parser/nodes.rb', line 798 def double_colon_l @double_colon_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text Foo::Bar ~~~~~~~~ “`
816 817 818 |
# File 'lib/lib-ruby-parser/nodes.rb', line 816 def expression_l @expression_l end |
#name ⇒ String (readonly)
Name of the constant, ‘String(“Foo”)` for Foo
789 790 791 |
# File 'lib/lib-ruby-parser/nodes.rb', line 789 def name @name end |
#name_l ⇒ Loc (readonly)
Location of the constant name
“‘text Foo::Bar
~~~
“‘
807 808 809 |
# File 'lib/lib-ruby-parser/nodes.rb', line 807 def name_l @name_l end |
#scope ⇒ Node? (readonly)
Scope where the constant is taken from:
-
‘Some(Const(“A”))` for
A::B -
Noneif it’s taken from the current scope (i.e.A) -
‘Some(Cbase)` if it’s taken from the global scope (i.e.
::A)
785 786 787 |
# File 'lib/lib-ruby-parser/nodes.rb', line 785 def scope @scope end |