smogon 0.7 → 0.7.1

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: 5efd122754905b76c20a3a36163bd0ff435e5119
4
- data.tar.gz: ddff2489eeff93a416e6c4cfac04346d198c21d3
3
+ metadata.gz: 4d8b152fd90e8ad785493b329c4b02f1d1cf86fc
4
+ data.tar.gz: dbd5273fe3a2fb6023bf219ef2afe2bf371c66e4
5
5
  SHA512:
6
- metadata.gz: 7256f3c29f5518b996825fe08e385d56e715f17705a07c9483adf7e97831ad922495c6ffd8d7cd2fee78866081ee9bfbcbc1e83693c08ba0959f4b0d4d31d60c
7
- data.tar.gz: '082911c49504411c00ffbef753a067f5b2a2105dbc5ac0dcdc1b4f8cddd30dd120c09431b43fe1fa454fe9d742d35b315cf31a4d31fc9dd7ccfe065fc97a43c2'
6
+ metadata.gz: 837d8b7a60a9140827e16522c7dce450b2dfd9946c25e5efcd2f5a96a8dbf61fbc0a227c0cbb5aafc18542754e69a80a8eddb3917f69cc026f278bc7f713542a
7
+ data.tar.gz: 5dfd9c2109a3166becc30aa12f78dee343dc4b1ff50a6d7b3ffcbbb8a6b72d10dc6fc2320d7366ee02245a6d453a9d278968c530711dfe77363ca06e9e41ee24
@@ -34,8 +34,10 @@ module Smogon
34
34
 
35
35
  def to_s
36
36
  attributes.map do |attr|
37
- "#{attr.capitalize}: #{public_send(attr)}"
38
- end.join("\n")
37
+ val = public_send(attr)
38
+ val = val.join(', ') if val.is_a?(Array)
39
+ val == '' ? nil : "#{attr.capitalize}: #{val}"
40
+ end.compact.join("\n")
39
41
  end
40
42
 
41
43
  def url
@@ -33,12 +33,18 @@ module Smogon
33
33
  @name = response['name']
34
34
  @evolutions = response['evos']
35
35
  @genfamily = response['genfamily']
36
- @moves = moves
36
+
37
+ if moves.include?('Hidden Power Fire')
38
+ moves.delete_if { |move| move.start_with?('Hidden Power ') }
39
+ moves << 'Hidden Power'
40
+ end
41
+ @moves = moves
37
42
 
38
43
  alts = response['alts'][0]
39
44
  @base_stats = alts.fetch_values(*STATS)
40
45
  @weight = alts['weight']
41
46
  @height = alts['height']
47
+ @types = alts['types']
42
48
  @abilities = alts['abilities']
43
49
  end
44
50
 
@@ -18,5 +18,5 @@
18
18
  #++
19
19
 
20
20
  module Smogon
21
- VERSION = '0.7'
21
+ VERSION = '0.7.1'
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'
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano