Exception: RuneterraCards::UnrecognizedVersionError

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

Overview

This exception is raised if the deck code version number in the deck code is not one we can handle. This could mean this isn't a deck code (especially if the version number is very different to the one expected), or it could mean Riot has updated the deck code version and you need to update this library.

If updating this library fails to resolve the issue, and you are sure this is a deck code, check GitHub for an issue relating to this. If none exists, then file one!

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expected, got) ⇒ UnrecognizedVersionError

Returns a new instance of UnrecognizedVersionError.

Parameters:

  • expected (Fixnum)

    The version number we were expecting to see in the deck code.

  • got (Fixnum)

    The version number we actually got.


40
41
42
43
44
45
# File 'lib/runeterra_cards/errors.rb', line 40

def initialize(expected, got)
  super(
    "Unrecognized deck code version number: #{got}, was expecting: #{expected}. "\
    'Possibly an invalid deck code, possibly you need to update the deck code library version.')
  @version = got
end

Instance Attribute Details

#versionFixnum

Returns the version number encountered in the deck code.

Returns:

  • (Fixnum)

    the version number encountered in the deck code


36
37
38
# File 'lib/runeterra_cards/errors.rb', line 36

def version
  @version
end