Class: Yoda::AST::ValueVnode

Inherits:
Vnode
  • Object
show all
Defined in:
lib/yoda/ast/value_vnode.rb

Instance Attribute Summary collapse

Attributes inherited from Vnode

#comments_by_node, #parent

Instance Method Summary collapse

Methods inherited from Vnode

#constant?, #empty?, #identifier, #inspect, #nesting, #present?, #try, #wrap_child

Methods included from Yoda::AST::Vnode::CommentPositional

#comments_by_vnode, #positionally_nearest_comment, #positionally_nearest_commenting_node

Methods included from Yoda::AST::Vnode::Positional

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

Methods included from Yoda::AST::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

#initialize(name, **kwargs) ⇒ ValueVnode

Returns a new instance of ValueVnode.

Parameters:

  • value (Object)


13
14
15
16
# File 'lib/yoda/ast/value_vnode.rb', line 13

def initialize(name, **kwargs)
  @value = value
  super(**kwargs)
end

Instance Attribute Details

#valueObject (readonly)

Returns:

  • (Object)


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

def value
  @value
end

Instance Method Details

#childrenArray<Node>?

Returns:

  • (Array<Node>, nil)


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

def children
  []
end

#inspect_contentObject



23
24
25
# File 'lib/yoda/ast/value_vnode.rb', line 23

def inspect_content
  value
end

#typeSymbol

Returns:

  • (Symbol)


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

def type
  :value
end