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.



81
82
83
84
# File 'lib/hocon/impl/tokens.rb', line 81

def initialize(origin, s)
  super(TokenType::UNQUOTED_TEXT, origin)
  @value = s
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



85
86
87
# File 'lib/hocon/impl/tokens.rb', line 85

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



95
96
97
# File 'lib/hocon/impl/tokens.rb', line 95

def ==(other)
  super(other) && other.value == @value
end

#can_equal(o) ⇒ Object



91
92
93
# File 'lib/hocon/impl/tokens.rb', line 91

def can_equal(o)
  o.is_a?(UnquotedText)
end

#hashObject



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

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

#to_sObject



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

def to_s
  "'#{value}'"
end

#token_textObject



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

def token_text
  @value
end