Exception: ComponentEmbeddedRuby::UnexpectedTokenError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/component_embedded_ruby/unexpected_token_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expected, got) ⇒ UnexpectedTokenError



5
6
7
8
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 5

def initialize(expected, got)
  @expected = expected
  @got = got
end

Instance Attribute Details

#expectedObject (readonly)

Returns the value of attribute expected.



3
4
5
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 3

def expected
  @expected
end

#gotObject (readonly)

Returns the value of attribute got.



3
4
5
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 3

def got
  @got
end

Instance Method Details

#messageObject



10
11
12
# File 'lib/component_embedded_ruby/unexpected_token_error.rb', line 10

def message
  "Unexpected token at column #{got.position}, got #{got.value}#{expected_message}."
end