This is the Magic: The Gathering SDK Ruby implementation. It is a wrapper around the MTG API of magicthegathering.io.
Add this line to your application's Gemfile:
gem 'mtg_sdk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mtg_sdk
To change the API version (currently defaults to version 1)
MTG.configure do |config|
config.api_version = 2
end
Card
Set
ForeignName
Ruling
Legality
Subtype
Supertype
Type
Changelog
name
multiverse_id
layout
names
mana_cost
cmc
colors
color_identity
type
supertypes
subtypes
rarity
text
flavor
artist
number
power
toughness
loyalty
variations
watermark
border
timeshifted
hand
life
reserved
release_date
starter
rulings
foreign_names
printings
original_text
original_type
legalities
source
image_url
set
set_name
id
code
name
gatherer_code
old_code
magic_cards_info_code
release_date
border
type
block
online_only
booster
mkm_id
mkm_name
language
name
multiverse_id
date
text
format
legality
version
release_date
details
card = MTG::Card.find(386616)
cards = MTG::Card.where(set: 'ktk').where(subtypes: 'warrior,human').all
cards = MTG::Card.all
cards = MTG::Card.where(page: 5).where(pageSize: 100).all
set = MTG::Set.find('ktk')
sets = MTG::Set.where(name: 'khans').all
sets = MTG::Set.all
types = MTG::Type.all
subtypes = MTG::Subtype.all
supertypes = MTG::Supertype.all
- Fork it ( https://github.com/[my-github-username]/mtg-sdk-ruby/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request