Class: Hocon::Impl::Tokens::UnquotedText

Inherits:
Token
  • Object
show all
Defined in:
lib/hocon/impl/tokens.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject (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

#hashObject



100
101
102
# File 'lib/hocon/impl/tokens.rb', line 100

def hash
  41 * (41 + super) + value.hash
end

#to_sObject



88
89
90
# File 'lib/hocon/impl/tokens.rb', line 88

def to_s
  "'#{value}'"
end

#token_textObject



104
105
106
# File 'lib/hocon/impl/tokens.rb', line 104

def token_text
  @value
end