Exception: Inform::DuplicateVerb

Inherits:
StandardError
  • Object
show all
Defined in:
lib/runtime/grammar_parser.rb

Overview

The DuplicateVerb error class

Constant Summary collapse

UnknownString =
'unknown'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verb) ⇒ DuplicateVerb

Returns a new instance of DuplicateVerb.



225
226
227
228
229
230
# File 'lib/runtime/grammar_parser.rb', line 225

def initialize(verb)
  super()
  @verb = verb
  @file = UnknownString
  @line = UnknownString
end

Instance Attribute Details

#file=(value) ⇒ Object (writeonly)

Sets the attribute file

Parameters:

  • value

    the value to set the attribute file to.



223
224
225
# File 'lib/runtime/grammar_parser.rb', line 223

def file=(value)
  @file = value
end

#line=(value) ⇒ Object (writeonly)

Sets the attribute line

Parameters:

  • value

    the value to set the attribute line to.



223
224
225
# File 'lib/runtime/grammar_parser.rb', line 223

def line=(value)
  @line = value
end

Instance Method Details

#to_sObject



232
233
234
# File 'lib/runtime/grammar_parser.rb', line 232

def to_s
  "(#{@file}):#{@line}: verb error, verb '#{@verb}', already defined"
end