Pokemon TCG SDK - Ruby
Ruby
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
Gemfile
LICENSE.txt
README.md
Rakefile
pokemon_tcg_sdk.gemspec

README.md

Pokémon TCG SDK

Gem Version Build Status Dependency Status Code Climate Test Coverage

This is the Pokémon TCG SDK Ruby implementation. It is a wrapper around the Pokémon TCG API of pokemontcg.io.

Installation

Add this line to your application's Gemfile:

gem 'pokemon_tcg_sdk'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pokemon_tcg_sdk

Usage

To change the API version (currently defaults to version 1)

Pokemon.configure do |config|
  config.api_version = 2
end

Classes

Card
Set
Type
Supertype
Subtype
Ability
AncientTrait
Attack
TypeValue

Properties Per Class

Card

id
name
national_pokedex_number
image_url
image_url_hi_res
subtype
supertype
ability
ancient_trait
hp
number
artist
rarity
series
set
set_code
retreat_cost
converted_retreat_cost
text
types
attacks
weaknesses
resistances
evolves_from

Set

code
name
series
total_cards
symbol_url
logo_url
standard_legal
expanded_legal
release_date
updated_at

Ability

name
text
type

AncientTrait

name
text

Attack

cost
name
text
damage
converted_energy_cost

TypeValue

type
value

Functions Available

Find a card by id

card = Pokemon::Card.find('xy1-1')

Filter Cards via query parameters

cards = Pokemon::Card.where(set: 'generations', supertype: 'pokemon')

Find all cards (will take awhile)

cards = Pokemon::Card.all

Get all cards, but only a specific page of data

cards = Pokemon::Card.where(page: 5, pageSize: 100)

Find a set by code

set = Pokemon::Set.find('base1')

Filter sets via query parameters

sets = Pokemon::Set.where(standardLegal: true)

Get all Sets

sets = Pokemon::Set.all

Get all Types

types = Pokemon::Type.all

Get all Subtypes

subtypes = Pokemon::Subtype.all

Get all Supertypes

supertypes = Pokemon::Supertype.all

Contributing

  1. Fork it ( https://github.com/[my-github-username]/pokemon-tcg-sdk-ruby/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request