Class: Lkml::Tokens::ContentToken

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

Constant Summary

Constants inherited from Token

Token::TOKEN_ID

Instance Attribute Summary collapse

Attributes inherited from Token

#line_number

Instance Method Summary collapse

Methods inherited from Token

#id, #inspect

Constructor Details

#initialize(value, line_number) ⇒ ContentToken

Returns a new instance of ContentToken.



36
37
38
39
# File 'lib/lkml/tokens.rb', line 36

def initialize(value, line_number)
  super(line_number)
  @value = value
end

Instance Attribute Details

#valueObject

literals may be mutated after lex (e.g. hyphen join)



34
35
36
# File 'lib/lkml/tokens.rb', line 34

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



41
42
43
# File 'lib/lkml/tokens.rb', line 41

def ==(other)
  instance_of?(other.class) && value == other.value
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/lkml/tokens.rb', line 45

def eql?(other)
  self == other
end

#hashObject



49
50
51
# File 'lib/lkml/tokens.rb', line 49

def hash
  [self.class, value].hash
end