oakdex-pokemon 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oakdex/pokemon.rb +10 -0
- data/lib/oakdex/pokemon/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82c5209a5ec9f13269d3cfc1c8cfcf677434ef10
|
4
|
+
data.tar.gz: bea6eed9a714601ffa3dab265c960d23fe64cb0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92021e9d3db8a863e3808f24534e178e85f06d7b3beddc2429c60191292f5032e9c3da3b1e83d625c0fbce7932dcd9b1447a78dbf9c3633d405215a42f14473d
|
7
|
+
data.tar.gz: 772ca3a170dfd55f7293cfbd7a776a91cddbb3573fe2c62afc4589497ef8ea7a9bab70e63c397c3d219d3916aa771375f577a2d57a1ce53d8fba9d489f9fd389
|
data/lib/oakdex/pokemon.rb
CHANGED
@@ -240,6 +240,16 @@ module Oakdex
|
|
240
240
|
species
|
241
241
|
end
|
242
242
|
|
243
|
+
def dup
|
244
|
+
duplicated = super
|
245
|
+
new_attributes = @attributes.dup
|
246
|
+
new_attributes[:moves] = new_attributes[:moves].map(&:dup)
|
247
|
+
new_attributes[:growth_events] = new_attributes[:growth_events].map(&:dup)
|
248
|
+
duplicated.instance_variable_set(:@attributes, new_attributes)
|
249
|
+
|
250
|
+
duplicated
|
251
|
+
end
|
252
|
+
|
243
253
|
def to_json
|
244
254
|
JSON.dump(to_h)
|
245
255
|
end
|