Class: Hocon::Impl::ConfigNodeComment

Inherits:
ConfigNodeSingleToken show all
Defined in:
lib/hocon/impl/config_node_comment.rb

Instance Attribute Summary

Attributes inherited from ConfigNodeSingleToken

#token

Instance Method Summary collapse

Methods inherited from ConfigNodeSingleToken

#tokens

Methods included from AbstractConfigNode

#==, #hash, #render, #tokens

Methods included from Parser::ConfigNode

#render

Constructor Details

#initialize(comment) ⇒ ConfigNodeComment

Returns a new instance of ConfigNodeComment.



9
10
11
12
13
14
# File 'lib/hocon/impl/config_node_comment.rb', line 9

def initialize(comment)
  super(comment)
  unless Hocon::Impl::Tokens.comment?(@token)
    raise Hocon::ConfigError::ConfigBugOrBrokenError, 'Tried to create a ConfigNodeComment from a non-comment token'
  end
end

Instance Method Details

#comment_textObject



16
17
18
# File 'lib/hocon/impl/config_node_comment.rb', line 16

def comment_text
  Hocon::Impl::Tokens.comment_text(@token)
end