Class: Hocon::Impl::Tokens::UnquotedText
- Defined in:
- lib/hocon/impl/tokens.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #can_equal(o) ⇒ Object
- #hash ⇒ Object
-
#initialize(origin, s) ⇒ UnquotedText
constructor
A new instance of UnquotedText.
- #to_s ⇒ Object
- #token_text ⇒ Object
Constructor Details
#initialize(origin, s) ⇒ UnquotedText
Returns a new instance of UnquotedText.
82 83 84 85 |
# File 'lib/hocon/impl/tokens.rb', line 82 def initialize(origin, s) super(TokenType::UNQUOTED_TEXT, origin) @value = s end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
86 87 88 |
# File 'lib/hocon/impl/tokens.rb', line 86 def value @value end |
Instance Method Details
#==(other) ⇒ Object
96 97 98 |
# File 'lib/hocon/impl/tokens.rb', line 96 def ==(other) super(other) && other.value == @value end |
#can_equal(o) ⇒ Object
92 93 94 |
# File 'lib/hocon/impl/tokens.rb', line 92 def can_equal(o) o.is_a?(UnquotedText) end |
#hash ⇒ Object
100 101 102 |
# File 'lib/hocon/impl/tokens.rb', line 100 def hash 41 * (41 + super) + value.hash end |
#to_s ⇒ Object
88 89 90 |
# File 'lib/hocon/impl/tokens.rb', line 88 def to_s "'#{value}'" end |
#token_text ⇒ Object
104 105 106 |
# File 'lib/hocon/impl/tokens.rb', line 104 def token_text @value end |