Class: SyntaxTree::Index::MethodDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/index.rb

Overview

This entry represents a method definition using the def keyword.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nesting, name, location, comments) ⇒ MethodDefinition

Returns a new instance of MethodDefinition.



62
63
64
65
66
67
# File 'lib/syntax_tree/index.rb', line 62

def initialize(nesting, name, location, comments)
  @nesting = nesting
  @name = name
  @location = location
  @comments = comments
end

Instance Attribute Details

#commentsObject (readonly)

Returns the value of attribute comments.



60
61
62
# File 'lib/syntax_tree/index.rb', line 60

def comments
  @comments
end

#locationObject (readonly)

Returns the value of attribute location.



60
61
62
# File 'lib/syntax_tree/index.rb', line 60

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



60
61
62
# File 'lib/syntax_tree/index.rb', line 60

def name
  @name
end

#nestingObject (readonly)

Returns the value of attribute nesting.



60
61
62
# File 'lib/syntax_tree/index.rb', line 60

def nesting
  @nesting
end