Class: Campgrounds::CampsiteSearch
- Defined in:
- lib/campgrounds/campsite_search.rb
Constant Summary collapse
- Path =
'/campsites'
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#find(options = {}) ⇒ Object
A cleaned up version of the request method below.
- #request(options = {}) ⇒ Object
Methods inherited from Base
#campground_details, #campground_search, #campsite_search, #initialize
Constructor Details
This class inherits a constructor from Campgrounds::Base
Instance Method Details
#find(options = {}) ⇒ Object
A cleaned up version of the request method below. Updated to use strings or boolean values instead of varius numbers. Required Parameters
contractCode: “contractCode” is a syonym for contractID, which is what is returned by the Campground Search API. It specifies the jurisdiction for the campground. This parameter must be used in conjuction with parkId.
parkId: Facility ID “parkId” is a synonym for “facilityID”, which is returned by the Campground Search API. It is a unique identifier for the campground.
Optional Parameters
siteType: If unspecified, all site types are returned.
"rv": RV Sites
"cabin": Cabins or Lodgings
"tent": Tent
"trailer": Trailer
"group": Group Site
"day": Day Use
"horse": Horse Site
"boat": Boat Site
arvDate: Arrival Date lengthOfStay: When combined with arvDate, this parameter determines how long the camper would like to reserve the campground. eqpLen: Equipment Length maxPeople: Number of campers
hookup: Electric Hookup
"15+": 15 Amps or More
"20+": 20 Amps or More
"30+": 30 Amps or More
"50+": 50 Amps or More
water: Water Hookup. Boolean. sewer: Sewer Hookup. Boolean. pull: Pull Through Driveway. Boolean. pets: Pets Allowed. Boolean. waterfront: Waterfront Sites. Boolean.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/campgrounds/campsite_search.rb', line 47 def find(={}) case [:siteType] when "rv" [:siteType] = 2001 when "cabin" [:siteType] = 10001 when "tent" [:siteType] = 2003 when "trailer" [:siteType] = 2002 when "group" [:siteType] = 9002 when "day" [:siteType] = 9001 when "horse" [:siteType] = 3001 when "boat" [:siteType] = 2004 end case [:hookup] when "15+" [:hookup] = 3002 when "20+" [:hookup] = 3003 when "30+" [:hookup] = 3004 when "50+" [:hookup] = 3005 end [:water] = 3006 if [:water] [:sewer] = 3007 if [:sewer] [:pull] = 3008 if [:pull] [:pets] = 3010 if [:pets] [:waterfront] = 3011 if [:waterfront] # Might return results array at some point, but returning the wrapper for now to keep results similar to default. return query(Path, ) end |
#request(options = {}) ⇒ Object
131 132 133 |
# File 'lib/campgrounds/campsite_search.rb', line 131 def request(={}) query(Path, ) end |