This library makes it easy to decode Legends of Runeterra deck codes, load Data Dragon metadata for cards, and perform operations on the data.


Add the following to your Gemfile:

gem 'runeterra_cards', '~> 0.7.0'

Or, if you're building a Gem, your .gemspec:

  spec.add_dependency 'runeterra_cards', '~> 0.7.0'

Ruby version support

  • Ruby: 2.6, 2.7, 3.0, 3.1
  • JRuby: 9.3 only
  • TruffleRuby: 20, 21, 22

Note that only Linux and Windows are included in automated testing, although other platforms are expected to work. Also note that truffleruby compatibility is not tested on Windows.

Updates & Versioning

This library will conform to semantic versioning once it hits 1.0. In the meantime, you can rely on the minor version (Y in x.Y.z) being bumped for backwards-incompatible changes.

All changes are documented in the CHANGELOG.

Main Concepts

Your typical main entry points to this library will be RuneterraCards::CardSet for manipulating deck codes and/or RuneterraCards::Metadata for handling Data Dragon card data.


Load a deck code:

require 'runeterra_cards'

deck = RuneterraCards::CardSet.from_deck_code(deck_code)

deck.count_for_card_code('02BW053') #=> 2 do |card, count|
  puts "#{card} x#{count}"

Load metadata from Legends of Runeterra Data Dragon:

require 'runeterra_cards'


.add_set_file 'set1-en_us.json'
.add_set_file 'set2-en_us.json'

card = .lookup_card '02BW053' #=> "Nautilus"

Development & Contributing

See the Github project for more details.