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.



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

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



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

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

#can_equal(o) ⇒ Object



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

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

#hashObject



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

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

#to_sObject



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

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

#token_textObject



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

def token_text
  @value
end