Exception: NoEntryError

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

Instance Method Summary collapse

Constructor Details

#initialize(target_entry) ⇒ NoEntryError

Raised when a given entry does not exist in the compendium

Parameters:

* `target_entry`: Non-existant input entry that causes error.
    - type: str, int


13
14
15
16
17
18
19
# File 'lib/hyrule_compendium.rb', line 13

def initialize(target_entry)
    if target_entry.is_a? String
        super "Entry with name '#{target_entry}' not in compendium."
    elsif target_entry.is_a? Integer
        super "Entry with ID '#{target_entry}' not in compendium."
    end
end