smogon 0.7.3 → 0.7.4

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: 172cb6e2112becbe79f998431bc082ab7d290640
4
- data.tar.gz: '0877ad07c8fef913144a31d4fa71f47711a5a253'
3
+ metadata.gz: 36e6317904d05cb1a72d661948909788b219ec2a
4
+ data.tar.gz: 18fdf5d8885847bbab7c8d710e64e39ef0b7a3af
5
5
  SHA512:
6
- metadata.gz: f3e6c3d3f6d7722ddcebc43ed13d9f37dc1758834e3b396cac39f88e1310c37f8d7d02a2edd5b682e93f437c5323b8e6fadfce93aecbf73ac8219bde50306e0d
7
- data.tar.gz: ba7218e77906c01c24cc730ddb9db2b586879c40df31b8dae2e55be407718a3d19cb24d885d4930e8bc0927145f0d95fbc39f11c8d130487f0ca71b5b512d0e6
6
+ metadata.gz: 710c8957b4399ea1c400f9a135809fcfa23de46534d37d70bb0bbc1c6eaeceeea5f37e354ad7edfd57745a3907d5d5fb549d5f796c5809e7dedd72d9799570dc
7
+ data.tar.gz: c25b69961755536d69c2a9e5a78444b822d6b86d5ca8fefabd55ca39962f3333a6c5c1fa73332abb8415be26504cb4901f70f1df665e5708dd4ec88b8783871d
@@ -20,7 +20,9 @@
20
20
  module Smogon
21
21
  module Type
22
22
  class Base
23
- def initialize(response)
23
+ def initialize(response = nil)
24
+ return unless response
25
+
24
26
  attributes.each do |attr|
25
27
  public_send("#{attr}=", response[attr])
26
28
  end
@@ -26,7 +26,9 @@ module Smogon
26
26
 
27
27
  attr_accessor(*ATTRIBUTES)
28
28
 
29
- def initialize(pokemon, tier, moveset)
29
+ def initialize(pokemon = nil, tier, moveset)
30
+ return if !pokemon
31
+
30
32
  @pokemon = pokemon
31
33
  @name = moveset['name']
32
34
  # @description = moveset['description']
@@ -29,7 +29,9 @@ module Smogon
29
29
  TYPE = 'pokemon'.freeze
30
30
  STATS = %w(hp atk def spa spd spe).freeze
31
31
 
32
- def initialize(response, moves)
32
+ def initialize(response = nil, moves)
33
+ return unless response
34
+
33
35
  @name = response['name']
34
36
  @evolutions = response['evos']
35
37
  @genfamily = response['genfamily']
@@ -18,5 +18,5 @@
18
18
  #++
19
19
 
20
20
  module Smogon
21
- VERSION = '0.7.3'
21
+ VERSION = '0.7.4'
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smogon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano