Exception: Inform::DuplicateVerb

Inherits:
StandardError
  • Object
show all
Defined in:
lib/story_teller/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.



238
239
240
241
242
243
# File 'lib/story_teller/grammar_parser.rb', line 238

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.



236
237
238
# File 'lib/story_teller/grammar_parser.rb', line 236

def file=(value)
  @file = value
end

#line=(value) ⇒ Object (writeonly)

Sets the attribute line

Parameters:

  • value

    the value to set the attribute line to.



236
237
238
# File 'lib/story_teller/grammar_parser.rb', line 236

def line=(value)
  @line = value
end

Instance Method Details

#to_sObject



245
246
247
# File 'lib/story_teller/grammar_parser.rb', line 245

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