Exception: RuneterraCards::UnrecognizedFactionError

Inherits:
DeckCodeParseError show all
Defined in:
lib/runeterra_cards/errors.rb

Overview

This exception is raised if the deck code contains an unexpected faction number. (see the table at https://github.com/RiotGames/LoRDeckCodes for what ‘faction number’ means.) This most likely means that Legends of Runeterra has a new faction and you need to update to a newer version of this library to handle it.

Check that the #faction_number causing issues is listed in the table on Github. If it isn’t then something else has gone wrong. If it is, and updating this library doesn’t fix the issue, then the library needs updating - file an issue.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(faction_number) ⇒ UnrecognizedFactionError

Returns a new instance of UnrecognizedFactionError.

Parameters:

  • faction_number (Fixnum)

    The faction number we encountered and did not recognise.



60
61
62
63
64
65
# File 'lib/runeterra_cards/errors.rb', line 60

def initialize(faction_number)
  super(
    "Unrecognized faction number '#{faction_number}'."\
    ' Possibly you need to update this library to a newer version')
  @faction_number = faction_number
end

Instance Attribute Details

#faction_numberFixnum (readonly)

Returns the faction number that was unrecognized.

Returns:

  • (Fixnum)

    the faction number that was unrecognized



57
58
59
# File 'lib/runeterra_cards/errors.rb', line 57

def faction_number
  @faction_number
end