Class: LibRubyParser::Nodes::Class

Inherits:
LibRubyParser::Node show all
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

Instance Attribute Details

#bodyNode? (readonly)

Body of the method, None if there's no body.

Returns:



708
709
710
# File 'lib/lib-ruby-parser/nodes.rb', line 708

def body
  @body
end

#end_lLoc (readonly)

Location of the end keyword.

class Foo; end
           ~~~

Returns:



737
738
739
# File 'lib/lib-ruby-parser/nodes.rb', line 737

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

class Foo; end
~~~~~~~~~~~~~~

Returns:



746
747
748
# File 'lib/lib-ruby-parser/nodes.rb', line 746

def expression_l
  @expression_l
end

#keyword_lLoc (readonly)

Location of the class keyword.

class Foo; end
~~~~~

Returns:



717
718
719
# File 'lib/lib-ruby-parser/nodes.rb', line 717

def keyword_l
  @keyword_l
end

#nameNode (readonly)

Name of the class, String("Foo") for class Foo; end

Returns:



698
699
700
# File 'lib/lib-ruby-parser/nodes.rb', line 698

def name
  @name
end

#operator_lLoc? (readonly)

Location of the < operator

class A < B; end
        ~

None if there's no explicit superclass given.

Returns:



728
729
730
# File 'lib/lib-ruby-parser/nodes.rb', line 728

def operator_l
  @operator_l
end

#superclassNode? (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)

Returns:



704
705
706
# File 'lib/lib-ruby-parser/nodes.rb', line 704

def superclass
  @superclass
end