Class: Hocon::Impl::ConfigNodeComment
- Inherits:
-
ConfigNodeSingleToken
- Object
- ConfigNodeSingleToken
- Hocon::Impl::ConfigNodeComment
- Defined in:
- lib/hocon/impl/config_node_comment.rb
Instance Attribute Summary
Attributes inherited from ConfigNodeSingleToken
Instance Method Summary collapse
- #comment_text ⇒ Object
-
#initialize(comment) ⇒ ConfigNodeComment
constructor
A new instance of ConfigNodeComment.
Methods inherited from ConfigNodeSingleToken
Methods included from AbstractConfigNode
Methods included from Parser::ConfigNode
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_text ⇒ Object
16 17 18 |
# File 'lib/hocon/impl/config_node_comment.rb', line 16 def comment_text Hocon::Impl::Tokens.comment_text(@token) end |