scryfall 0.1.8 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -1
- data/lib/scryfall/api.rb +2 -2
- data/lib/scryfall/base.rb +0 -0
- data/lib/scryfall/cards.rb +16 -0
- data/lib/scryfall/error_handler.rb +0 -0
- data/lib/scryfall/errors.rb +0 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2af3560b509abc7263f3352c2a7ed89a0bd9f558a8863d5ef61bcbff93e3097d
|
4
|
+
data.tar.gz: 62d5b62b912d831adc186744a3702f38b3bf8c0ef245bf410fb7ed7c4596fe29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 130020646712432d62154f7c6413ebb1e73be7ec4f22007bb7b006a19fc677eeec1be61dd22ff8c14788e7824db0632a39c317641a893bb2253bcba069461f14
|
7
|
+
data.tar.gz: 8b1f2d712985f2e3b588ef758949fbd5ef5492122bc7d086a3f00ba7a972687277e970b61cb41937908f5cf50769483183e0dd1ad5e8ae34700badb1e9f96e0f
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# scryfall-rails
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/scryfall.svg)](https://badge.fury.io/rb/scryfall)
|
3
|
+
[![CircleCI](https://circleci.com/gh/jlcarruda/scryfall-rails/tree/master.svg?style=svg)](https://circleci.com/gh/jlcarruda/scryfall-rails/tree/master)
|
3
4
|
|
4
5
|
A simple gem that utilizes the Scryfall API to get Magic: the Gathering card information.
|
5
6
|
|
@@ -24,7 +25,7 @@ The Scryfall module have classes for each query on the Scryfall API. Each class
|
|
24
25
|
|
25
26
|
At first, there are only a few methods available:
|
26
27
|
|
27
|
-
# Cards
|
28
|
+
# ::Cards
|
28
29
|
### Named (fuzzy and exact)
|
29
30
|
|
30
31
|
It searches for cards named almost as the string passed (fuzzy), or with the exact name as the string passed (exact)
|
@@ -49,6 +50,28 @@ Scryfall::Cards.search "f:standard t:land id:UW"
|
|
49
50
|
Scryfall::Cards.search "f:standard t:creature", page: 2
|
50
51
|
```
|
51
52
|
|
53
|
+
### By IDs
|
54
|
+
|
55
|
+
The `Scryfall::Cards` class has methods to retrieve cards by its identifier in multiple platforms.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
# Returning the "Yargle, Glutton of Urborg" card by its IDs
|
59
|
+
|
60
|
+
# can be fetched by its MTGO id ...
|
61
|
+
Scryfall::Cards.with_mtgo_id 67691
|
62
|
+
|
63
|
+
# ... by its Arena id ...
|
64
|
+
Scryfall::Cards.with_arena_id 67330
|
65
|
+
|
66
|
+
# ... by its TCG Player id ...
|
67
|
+
Scryfall::Cards.with_tcgplayer_id 164756
|
68
|
+
|
69
|
+
# ... or by its unique ID.
|
70
|
+
Scryfall::Cards.with_id "645cfc1b-76f2-4823-9fb0-03cb009f8b32"
|
71
|
+
```
|
72
|
+
|
73
|
+
Cards that are not on those systems can't be retrieved by its ids. For example, the **Austere Command** card can't be fetched by an Arena Id because the card isn't in the game.
|
74
|
+
|
52
75
|
# Responses
|
53
76
|
|
54
77
|
The default response for all calls are JSON. If a `to_struct: true` is passed as argument, the return will be a `OpenStruct` Hash object.
|
data/lib/scryfall/api.rb
CHANGED
data/lib/scryfall/base.rb
CHANGED
File without changes
|
data/lib/scryfall/cards.rb
CHANGED
@@ -18,5 +18,21 @@ module Scryfall
|
|
18
18
|
|
19
19
|
api.get '/cards/search', params, args
|
20
20
|
end
|
21
|
+
|
22
|
+
def self.with_mtgo_id(id, **args)
|
23
|
+
api.get "/cards/mtgo/#{id}", {}, args
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.with_arena_id(id, **args)
|
27
|
+
api.get "/cards/arena/#{id}", {}, args
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.with_tcgplayer_id(id, **args)
|
31
|
+
api.get "/cards/tcgplayer/#{id}", {}, args
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.with_id(id, **args)
|
35
|
+
api.get "/cards/#{id}", {}, args
|
36
|
+
end
|
21
37
|
end
|
22
38
|
end
|
File without changes
|
data/lib/scryfall/errors.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scryfall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- João Lucas
|
@@ -70,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
|
74
|
-
rubygems_version: 2.7.7
|
73
|
+
rubygems_version: 3.0.1
|
75
74
|
signing_key:
|
76
75
|
specification_version: 4
|
77
76
|
summary: A gem made to contact Scryfall API
|