Class: Pokemongodb::Location
- Inherits:
-
Pokemongodb
- Object
- Pokemongodb
- Pokemongodb::Location
- Defined in:
- lib/pokemongodb/location.rb,
lib/pokemongodb/locations/gym.rb,
lib/pokemongodb/locations/city.rb,
lib/pokemongodb/locations/dock.rb,
lib/pokemongodb/locations/lake.rb,
lib/pokemongodb/locations/park.rb,
lib/pokemongodb/locations/port.rb,
lib/pokemongodb/locations/basin.rb,
lib/pokemongodb/locations/beach.rb,
lib/pokemongodb/locations/canal.rb,
lib/pokemongodb/locations/marsh.rb,
lib/pokemongodb/locations/ocean.rb,
lib/pokemongodb/locations/river.rb,
lib/pokemongodb/locations/church.rb,
lib/pokemongodb/locations/forest.rb,
lib/pokemongodb/locations/garden.rb,
lib/pokemongodb/locations/harbor.rb,
lib/pokemongodb/locations/meadow.rb,
lib/pokemongodb/locations/quarry.rb,
lib/pokemongodb/locations/school.rb,
lib/pokemongodb/locations/stream.rb,
lib/pokemongodb/locations/glacier.rb,
lib/pokemongodb/locations/library.rb,
lib/pokemongodb/locations/railway.rb,
lib/pokemongodb/locations/stadium.rb,
lib/pokemongodb/locations/wetland.rb,
lib/pokemongodb/locations/cemetary.rb,
lib/pokemongodb/locations/farmland.rb,
lib/pokemongodb/locations/hospital.rb,
lib/pokemongodb/locations/landmark.rb,
lib/pokemongodb/locations/mountain.rb,
lib/pokemongodb/locations/woodland.rb,
lib/pokemongodb/locations/reservoir.rb,
lib/pokemongodb/locations/riverbank.rb,
lib/pokemongodb/locations/ski_resort.rb,
lib/pokemongodb/locations/university.rb,
lib/pokemongodb/locations/golf_course.rb,
lib/pokemongodb/locations/grassy_area.rb,
lib/pokemongodb/locations/parking_lot.rb,
lib/pokemongodb/locations/residential.rb,
lib/pokemongodb/locations/arid_climate.rb,
lib/pokemongodb/locations/hiking_trail.rb,
lib/pokemongodb/locations/neighborhood.rb,
lib/pokemongodb/locations/warm_climate.rb,
lib/pokemongodb/locations/sports_center.rb,
lib/pokemongodb/locations/college_campus.rb,
lib/pokemongodb/locations/nature_reserve.rb,
lib/pokemongodb/locations/industrial_area.rb,
lib/pokemongodb/locations/industrial_park.rb,
lib/pokemongodb/locations/recreation_area.rb,
lib/pokemongodb/locations/shopping_center.rb
Direct Known Subclasses
AridClimate, Basin, Beach, Canal, Cemetary, Church, City, CollegeCampus, Dock, Farmland, Forest, Garden, Glacier, GolfCourse, GrassyArea, Gym, Harbor, HikingTrail, Hospital, IndustrialArea, IndustrialPark, Lake, Landmark, Library, Marsh, Meadow, Mountain, NatureReserve, Neighborhood, Ocean, Park, ParkingLot, Port, Quarry, Railway, RecreationArea, Reservoir, Residential, River, Riverbank, School, ShoppingCenter, SkiResort, SportsCenter, Stadium, Stream, University, WarmClimate, Wetland, Woodland
Defined Under Namespace
Classes: AridClimate, Basin, Beach, Canal, Cemetary, Church, City, CollegeCampus, Dock, Farmland, Forest, Garden, Glacier, GolfCourse, GrassyArea, Gym, Harbor, HikingTrail, Hospital, IndustrialArea, IndustrialPark, Lake, Landmark, Library, Marsh, Meadow, Mountain, NatureReserve, Neighborhood, Ocean, Park, ParkingLot, Port, Quarry, Railway, RecreationArea, Reservoir, Residential, River, Riverbank, School, ShoppingCenter, SkiResort, SportsCenter, Stadium, Stream, University, WarmClimate, Wetland, Woodland
Class Method Summary collapse
-
.all ⇒ Object
Returns array of all available locations.
-
.available_pokemon ⇒ Object
Returns array of pokemon who can use the move.
Methods inherited from Pokemongodb
Class Method Details
.all ⇒ Object
Returns array of all available locations.
Example:
>> Pokemongodb::Location.all
=> []
.available_pokemon ⇒ Object
Returns array of pokemon who can use the move
Example:
>> Pokemongodb::Location::Beach.available_pokemon
=> [Pokemongodb::Pokemon::Arcanine, Pokemongodb::Pokemon::Charizard... ]
69 70 71 72 73 74 75 |
# File 'lib/pokemongodb/location.rb', line 69 def self.available_pokemon pokemon_at_location = [] self.types.each do |type| pokemon_at_location += Pokemongodb::Pokemon.find_by_type(type) end pokemon_at_location.uniq end |