Class: Yoda::Parsing::Scopes::Root

Inherits:
Base
  • Object
show all
Defined in:
lib/yoda/parsing/scopes/root.rb

Overview

Represents root namespace.

Instance Attribute Summary

Attributes inherited from Base

#child_scopes, #method_definitions, #node, #parent

Instance Method Summary collapse

Methods inherited from Base

#ancestor_scopes, #find_evaluation_root_scope, #initialize, #inner_location?, #method?

Constructor Details

This class inherits a constructor from Yoda::Parsing::Scopes::Base

Instance Method Details

#body_nodeObject



10
11
12
# File 'lib/yoda/parsing/scopes/root.rb', line 10

def body_node
  body_nodes.first
end

#body_nodesObject



6
7
8
# File 'lib/yoda/parsing/scopes/root.rb', line 6

def body_nodes
  [node.children.last]
end

#kindObject



14
15
16
# File 'lib/yoda/parsing/scopes/root.rb', line 14

def kind
  :root
end

#scope_nameString

Returns:

  • (String)


19
20
21
# File 'lib/yoda/parsing/scopes/root.rb', line 19

def scope_name
  'Object'
end