Class: Yoda::AST::ConstantBaseNode

Inherits:
Node
  • Object
show all
Defined in:
lib/yoda/ast/constant_base_node.rb

Instance Attribute Summary

Attributes inherited from Node

#node

Attributes inherited from Vnode

#comments_by_node, #parent

Instance Method Summary collapse

Methods inherited from Node

#children, #identifier, #initialize, #kind, #source_map

Methods inherited from Vnode

#children, #empty?, #identifier, #initialize, #inspect, #inspect_content, #nesting, #present?, #try, #type, #wrap_child

Methods included from Vnode::CommentPositional

#comments_by_vnode, #positionally_nearest_comment, #positionally_nearest_commenting_node

Methods included from Vnode::Positional

#location, #positionally_include?, #positionally_nearest_child, #range, #source_map

Methods included from Vnode::CommentAssociation

#all_nodes_lazy, #associate_comments, #comments, #wrapping?

Methods included from Traversable

#query, #query_all, #query_ancestor, #query_ancestors

Methods included from MethodTraversable

#calc_current_location_method, #including_method, #method?

Methods included from NamespaceTraversable

#calc_current_location_namespace, #full_name, #namespace, #namespace?, #namespace_path, #root?

Constructor Details

This class inherits a constructor from Yoda::AST::Node

Instance Method Details

#absolute?true, false

Returns:

  • (true, false)


10
11
12
# File 'lib/yoda/ast/constant_base_node.rb', line 10

def absolute?
  true
end

#baseVnode?

Returns:



5
6
7
# File 'lib/yoda/ast/constant_base_node.rb', line 5

def base
  nil
end

#constant?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/yoda/ast/constant_base_node.rb', line 19

def constant?
  true
end

#constant_base?true, false

Returns:

  • (true, false)


15
16
17
# File 'lib/yoda/ast/constant_base_node.rb', line 15

def constant_base?
  true
end

#just_after_separator?(location) ⇒ true, false

Parameters:

  • location (Location)

Returns:

  • (true, false)


25
26
27
28
# File 'lib/yoda/ast/constant_base_node.rb', line 25

def just_after_separator?(location)
  return false unless node.location.double_colon
  location == Location.of_ast_location(node.location.double_colon.end)
end

#pathModel::Path

Returns:



31
32
33
# File 'lib/yoda/ast/constant_base_node.rb', line 31

def path
  Model::Path.new(path_name)
end

#path_name(base = nil) ⇒ String

Parameters:

  • base (String, Symbol, nil) (defaults to: nil)

Returns:

  • (String)


37
38
39
# File 'lib/yoda/ast/constant_base_node.rb', line 37

def path_name(base = nil)
  '::'
end