pokemongodb 1.1.0 → 1.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 +4 -4
- data/lib/pokemongodb/location.rb +13 -0
- 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: 61ae9f2893175efdc77d773fd8995db0d7008f15
|
4
|
+
data.tar.gz: cfc607d3b0c16d5b8a37eac9e0432bea534991da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d967594f7a7956e2702d2e470955c8ec53304ec1f4185ea6ded55a56a2d3686b16e690e3ba6b2cb677f2b724f39f541b15ac0777e8baba0b953e4d6e4638156
|
7
|
+
data.tar.gz: f6316d6934cbcbf36df8f1df71dd1797d147788e4d18641689ea9d4321b8c9a567d8628f0607f62aa514f27bd31005f8f6b466e92e5f3e818f7cc90abd47a500
|
data/lib/pokemongodb/location.rb
CHANGED
@@ -60,6 +60,19 @@ class Pokemongodb
|
|
60
60
|
Location::Woodland,
|
61
61
|
]
|
62
62
|
end
|
63
|
+
|
64
|
+
# Returns array of pokemon who can use the move
|
65
|
+
#
|
66
|
+
# Example:
|
67
|
+
# >> Pokemongodb::Location::Beach.available_pokemon
|
68
|
+
# => [Pokemongodb::Pokemon::Arcanine, Pokemongodb::Pokemon::Charizard... ]
|
69
|
+
def self.available_pokemon
|
70
|
+
pokemon_at_location = []
|
71
|
+
self.types.each do |type|
|
72
|
+
pokemon_at_location += Pokemongodb::Pokemon.find_by_type(type)
|
73
|
+
end
|
74
|
+
pokemon_at_location.uniq
|
75
|
+
end
|
63
76
|
end
|
64
77
|
end
|
65
78
|
|