Class: Hocon::Impl::Tokens::IgnoredWhitespace

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) ⇒ IgnoredWhitespace

Returns a new instance of IgnoredWhitespace.



109
110
111
112
# File 'lib/hocon/impl/tokens.rb', line 109

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



113
114
115
# File 'lib/hocon/impl/tokens.rb', line 113

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



123
124
125
# File 'lib/hocon/impl/tokens.rb', line 123

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

#can_equal(o) ⇒ Object



119
120
121
# File 'lib/hocon/impl/tokens.rb', line 119

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

#hashObject



127
128
129
# File 'lib/hocon/impl/tokens.rb', line 127

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

#to_sObject



115
116
117
# File 'lib/hocon/impl/tokens.rb', line 115

def to_s
  "'#{value}' (WHITESPACE)"
end

#token_textObject



131
132
133
# File 'lib/hocon/impl/tokens.rb', line 131

def token_text
  @value
end