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
=> []
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/pokemongodb/location.rb', line 9 def self.all [ Location::AridClimate, Location::Basin, Location::Beach, Location::Canal, Location::, Location::Church, Location::City, Location::CollegeCampus, Location::Dock, Location::Farmland, Location::Forest, Location::Garden, Location::Glacier, Location::GolfCourse, Location::GrassyArea, Location::Gym, Location::Harbor, Location::HikingTrail, Location::Hospital, Location::IndustrialArea, Location::IndustrialPark, Location::Lake, Location::Landmark, Location::Library, Location::Marsh, Location::Meadow, Location::Mountain, Location::NatureReserve, Location::Neighborhood, Location::Ocean, Location::Park, Location::ParkingLot, Location::Port, Location::Quarry, Location::Railway, Location::RecreationArea, Location::Reservoir, Location::Residential, Location::River, Location::Riverbank, Location::School, Location::ShoppingCenter, Location::SkiResort, Location::SportsCenter, Location::Stadium, Location::Stream, Location::University, Location::WarmClimate, Location::Wetland, Location::Woodland, ] end |
.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 |