Class: Hocon::Impl::ConfigNodeInclude

Inherits:
Object
  • Object
show all
Includes:
AbstractConfigNode
Defined in:
lib/hocon/impl/config_node_include.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AbstractConfigNode

#==, #hash, #render

Methods included from Parser::ConfigNode

#render

Constructor Details

#initialize(children, kind) ⇒ ConfigNodeInclude

Returns a new instance of ConfigNodeInclude.



10
11
12
13
# File 'lib/hocon/impl/config_node_include.rb', line 10

def initialize(children, kind)
  @children = children
  @kind = kind
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



15
16
17
# File 'lib/hocon/impl/config_node_include.rb', line 15

def children
  @children
end

#kindObject (readonly)

Returns the value of attribute kind.



15
16
17
# File 'lib/hocon/impl/config_node_include.rb', line 15

def kind
  @kind
end

Instance Method Details

#nameObject



25
26
27
28
29
30
31
32
# File 'lib/hocon/impl/config_node_include.rb', line 25

def name
  @children.each do |child|
    if child.is_a?(Hocon::Impl::ConfigNodeSimpleValue)
      return Hocon::Impl::Tokens.value(child.token).unwrapped
    end
  end
  nil
end

#tokensObject



17
18
19
20
21
22
23
# File 'lib/hocon/impl/config_node_include.rb', line 17

def tokens
  tokens = []
  @children.each do |child|
    tokens += child.tokens
  end
  tokens
end