scryfall 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -0
  3. data/lib/scryfall.rb +4 -4
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2dd0a6fe660501c155808d9c1ab0c8ccc601ed85539dc43a98285e2613d7805f
4
- data.tar.gz: 796a3d647327cb216fcccd9de9bee31f729bab8225dc26cd37d86cd6db6a20db
3
+ metadata.gz: cf32af09b3026944696a91897c7653f7f1bb74c7d2bfa7463f72aceb0797fc08
4
+ data.tar.gz: 671b861417f508c6ce0d71acc45118c58d28c8e70705bde612705806adedd4d8
5
5
  SHA512:
6
- metadata.gz: 8bac36af77d6698d143869bd599c53e03d694568a2782271861656d98839781f3008acbab83128db8bab1de4e73a967e6ef02d8ef1814cb29ac3a8d85887611e
7
- data.tar.gz: ac66a544c02c2db172838c01154572ef39f3c3ca531a516512cb15427db89640fb8bf3a89988b1c21399b4431f83df616b7199bace809736d15e80bc27a161f6
6
+ metadata.gz: f23d7118d4cc14573b3a9ca5fdbb43f26de2968744f7379155ba4792b607a6c00ebe0fe407b54ff29b67614b130b10c6d042f18e024886b6f3faee369ffa5d08
7
+ data.tar.gz: 9519a9e4b18ecb194031e325203d43a551affd3aabfcd55843dde379f5d0d807c666808a4fbd9ab8777a7f75bf6a10438e33bf024839105e831f518c8ba0f350
data/README.md CHANGED
@@ -2,3 +2,52 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/scryfall.svg)](https://badge.fury.io/rb/scryfall)
3
3
 
4
4
  A simple gem that utilizes the Scryfall API to get Magic: the Gathering card information.
5
+
6
+
7
+ ## Instalation
8
+
9
+ It will only be needed to specify it on your Gemfile:
10
+
11
+ ```ruby
12
+ gem 'scryfall'
13
+ ```
14
+
15
+ And then run the Bundler
16
+
17
+ ```ruby
18
+ bundle install
19
+ ```
20
+
21
+ # Usage
22
+
23
+ The Scryfall class will have class methods for each query on the Scryfall API. The methods will reflect their path on the official Scryfall API, following the logic of `Scryfall::<HTTP METHOD>_<PATH IN SNAKE CASE>_<VARIATION>`
24
+
25
+ At first, there are only a few methods available:
26
+
27
+ ## Cards Named (fuzzy and exact)
28
+
29
+ It searches for cards named almost as the string passed (fuzzy), or with the exact name as the string passed (exact)
30
+
31
+ ```ruby
32
+ # Fuzzy
33
+ Scryfall::get_cards_named_fuzzy "aust commd"
34
+
35
+ # Exact
36
+ Scryfall::get_cards_named_exact "Counterspell"
37
+ ```
38
+
39
+ ## Search Query
40
+
41
+ It can search a list of cards using the Scryfall syntax
42
+
43
+ ```ruby
44
+ # The search will return all the cards that fits on the query parameters
45
+ Scryfall::get_cards_search "f:standard t:land id:UW"
46
+
47
+ # It can be passed the page of the search. Each page of data has a maximum of 175 cards
48
+ Scryfall::get_cards_search "f:standard t:creature", page: 2
49
+ ```
50
+
51
+ # Response
52
+
53
+ The default response for all calls are JSON. If a `is_struct: true` is passed as argument, the return will be a `OpenStruct` Hash object.
data/lib/scryfall.rb CHANGED
@@ -19,12 +19,12 @@ class Scryfall
19
19
  end
20
20
  end
21
21
 
22
- def self.get_cards_named_fuzy(cardname)
23
- get '/cards/named', { fuzzy: cardname }
22
+ def self.get_cards_named_fuzy(cardname, **args)
23
+ get '/cards/named', { fuzzy: cardname }, args
24
24
  end
25
25
 
26
- def self.get_cards_named_exact(cardname)
27
- get '/cards/named', { exact: cardname }
26
+ def self.get_cards_named_exact(cardname, **args)
27
+ get '/cards/named', { exact: cardname }, args
28
28
  end
29
29
 
30
30
  def self.get_cards_search(query, **args)
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.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Lucas