GOT_wrapper 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5d0df2af96b0052f35e3fdb1e66aaa25db955f2
4
- data.tar.gz: 02372a74328841db97f8539023e609b5fe2facb0
3
+ metadata.gz: 3278b259a881584b76f7a1c0a79fb57882318b5e
4
+ data.tar.gz: 5bc05bdff8ba46b9d3b34b8e4aa19f86ecee44b4
5
5
  SHA512:
6
- metadata.gz: 76d7d9f633e3f5c8b97ee10dbfea2e01880120eb5ade6ccc01710db509dfa6ded71c38dd345c2cc4b8785eeb8c8532865d60585ea3a02cdf13f01d130c669ec1
7
- data.tar.gz: db763beb1a2b3d03f05ae6f55c50057e2f69b3cb76943f007b8e9e8c8f11b0c1da87cbffbec9f25924017426f9fea1576b538e8165b335441c5b8d53b72e588a
6
+ metadata.gz: 6144050425ea7d09a01432fa6f4239353852eb9a8dcd79e8e4a362b79c6320c1c968aaf9b4d150c02753728ad0e332ad9d7aa84dc61c94a0c4556c939cd9f5bc
7
+ data.tar.gz: 2d9493382efca14bdc15761a557f4a15096eb74e1674908869e4fcefe4313fc43cc75ec2fba5fca3029e54ccb5fe2e267b7505a80fe12957d7d9d3d4a3df91b2
data/README.md CHANGED
@@ -22,7 +22,14 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- Write usage instructions here
25
+ you can grab data of 400 different houses from a `.all` method:
26
+
27
+ ```ruby
28
+ GOTWrapper::House.all
29
+ ```
30
+
31
+ you will get a array of 400 houses, and you can call `.name` `.region` `.words` on your house element.
32
+
26
33
 
27
34
  ## Development
28
35
 
@@ -1,3 +1,3 @@
1
1
  module GOTWrapper
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/GOT_wrapper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "GOT_wrapper/version"
2
2
  require "unirest"
3
+ require "pry"
3
4
 
4
5
  module GOTWrapper
5
6
  class House
@@ -11,10 +12,17 @@ module GOTWrapper
11
12
  end
12
13
 
13
14
  def self.all
14
- houses_array = Unirest.get("http://www.anapioficeandfire.com/api/houses?").body
15
+ house_array = []
16
+ i = 1
17
+ while i < 41
18
+ house_array << Unirest.get("http://www.anapioficeandfire.com/api/houses?page="+ i.to_s).body
19
+ i += 1
20
+ end
15
21
  houses = []
16
- houses_array.each do |house|
17
- houses << House.new(house)
22
+ house_array.each do |tenhouse|
23
+ tenhouse.each do |house|
24
+ houses << House.new(house)
25
+ end
18
26
  end
19
27
  houses
20
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: GOT_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Yang