Class: LibRubyParser::Nodes::Class
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Class
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a class definition (using a class
keyword, Class.new
is just a method call)
Instance Attribute Summary collapse
-
#body ⇒ Node?
readonly
Body of the method,
None
if there's no body. -
#end_l ⇒ Loc
readonly
Location of the
end
keyword. -
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#keyword_l ⇒ Loc
readonly
Location of the
class
keyword. -
#name ⇒ Node
readonly
Name of the class,
String("Foo")
forclass Foo; end
. -
#operator_l ⇒ Loc?
readonly
Location of the
<
operator. -
#superclass ⇒ Node?
readonly
Superclass.
Instance Attribute Details
#body ⇒ Node? (readonly)
Body of the method, None
if there's no body.
708 709 710 |
# File 'lib/lib-ruby-parser/nodes.rb', line 708 def body @body end |
#end_l ⇒ Loc (readonly)
Location of the end
keyword.
class Foo; end
~~~
737 738 739 |
# File 'lib/lib-ruby-parser/nodes.rb', line 737 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
class Foo; end
~~~~~~~~~~~~~~
746 747 748 |
# File 'lib/lib-ruby-parser/nodes.rb', line 746 def expression_l @expression_l end |
#keyword_l ⇒ Loc (readonly)
Location of the class
keyword.
class Foo; end
~~~~~
717 718 719 |
# File 'lib/lib-ruby-parser/nodes.rb', line 717 def keyword_l @keyword_l end |
#name ⇒ Node (readonly)
Name of the class, String("Foo")
for class Foo; end
698 699 700 |
# File 'lib/lib-ruby-parser/nodes.rb', line 698 def name @name end |
#operator_l ⇒ Loc? (readonly)
Location of the <
operator
class A < B; end
~
None
if there's no explicit superclass given.
728 729 730 |
# File 'lib/lib-ruby-parser/nodes.rb', line 728 def operator_l @operator_l end |
#superclass ⇒ Node? (readonly)
Superclass. Can be an expression in cases like class A < (obj.foo + 1); end
None
if no explicit superclass given (i.e. class Foo; end
)
704 705 706 |
# File 'lib/lib-ruby-parser/nodes.rb', line 704 def superclass @superclass end |