diff --git a/lib/mtg_sdk/card.rb b/lib/mtg_sdk/card.rb index f2d603a..720c222 100644 --- a/lib/mtg_sdk/card.rb +++ b/lib/mtg_sdk/card.rb @@ -9,7 +9,7 @@ class Card :rarity, :text, :flavor, :artist, :number, :power, :toughness, :loyalty, :multiverse_id, :variations, :watermark, :border, :timeshifted, :hand, :life, :reserved, :release_date, :starter, :rulings, :foreign_names, :printings, :original_text, :original_type, :legalities, - :source, :image_url, :set, :id + :source, :image_url, :set, :id, :set_name # Get the resource string # diff --git a/lib/mtg_sdk/foreign_name.rb b/lib/mtg_sdk/foreign_name.rb index 192b5dc..86891e3 100644 --- a/lib/mtg_sdk/foreign_name.rb +++ b/lib/mtg_sdk/foreign_name.rb @@ -5,6 +5,6 @@ class ForeignName include Roar::JSON include LegalityRepresenter - attr_accessor :language, :name, :multiverse_id + attr_accessor :language, :name, :multiverse_id, :image_url end end diff --git a/lib/mtg_sdk/representers/card_representer.rb b/lib/mtg_sdk/representers/card_representer.rb index 3029ff9..931779e 100644 --- a/lib/mtg_sdk/representers/card_representer.rb +++ b/lib/mtg_sdk/representers/card_representer.rb @@ -38,6 +38,7 @@ module CardRepresenter property :original_type, as: :originalType property :source property :set + property :set_name, as: :setName property :id property :image_url, as: :imageUrl diff --git a/lib/mtg_sdk/representers/foreign_name_representer.rb b/lib/mtg_sdk/representers/foreign_name_representer.rb index 5d42c40..8f0d157 100644 --- a/lib/mtg_sdk/representers/foreign_name_representer.rb +++ b/lib/mtg_sdk/representers/foreign_name_representer.rb @@ -7,5 +7,6 @@ module ForeignNameRepresenter property :name property :language property :multiverse_id, as: :multiverseid + property :image_url, as: :imageUrl end end \ No newline at end of file diff --git a/lib/mtg_sdk/version.rb b/lib/mtg_sdk/version.rb index 285eb93..d15588d 100644 --- a/lib/mtg_sdk/version.rb +++ b/lib/mtg_sdk/version.rb @@ -1,3 +1,3 @@ module MTG - VERSION = "2.1.0" + VERSION = "2.2.0" end diff --git a/test/card_test.rb b/test/card_test.rb index 62a887c..41413aa 100644 --- a/test/card_test.rb +++ b/test/card_test.rb @@ -15,6 +15,7 @@ def test_find_returns_one_card assert card.subtypes.any?{|subtype| subtype == 'Arcane'} assert_equal 'Rare', card.rarity assert_equal 'SOK', card.set + assert_equal 'Saviors of Kamigawa', card.set_name assert_equal "Target opponent chooses a number. You may have that player lose that much life. If you don't, that player sacrifices all but that many permanents.", card.text assert_equal "\"Life is a series of choices between bad and worse.\"\n—Toshiro Umezawa", card.flavor assert_equal 'Tim Hildebrandt', card.artist @@ -23,7 +24,7 @@ def test_find_returns_one_card assert_equal 88803, card.multiverse_id assert_equal 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=88803&type=card', card.image_url assert card.rulings.any?{|ruling| ruling.date == Date.parse('2005-06-01')} - assert card.foreign_names.any?{|foreign_name| foreign_name.name == '破灭抉择'} + assert card.foreign_names.any?{|foreign_name| foreign_name.name == '破灭抉择' && foreign_name.image_url == 'http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=104898&type=card'} assert card.printings.any?{|printing| printing == 'SOK'} assert_equal "Target opponent chooses a number. You may have that player lose that much life. If you don't, that player sacrifices all but that many permanents.", card.original_text assert_equal 'Sorcery — Arcane', card.original_type