Class: Supercamp::Criteria::Campsite
- Defined in:
- lib/supercamp/criteria/campsite.rb
Direct Known Subclasses
Constant Summary collapse
- TYPES =
{ "rv" => 2001, "cabin" => 10001, "lodging" => 10001, "tent" => 2003, "trailer" => 2002, "group_site" => 9002, "day_use" => 9001, "horse_site" => 3001, "boat_site" => 2004 }
- PERKS =
{ "water" => 3007, "sewer" => 3007, "pull" => 3008, "pets" => 3010, "waterfront" => 3011 }
- ELECTRIC_HOOKUPS =
{ "15" => 3002, "20" => 3003, "30" => 3004, "50" => 3005 }
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
-
#arrival(date) ⇒ Object
arvdate: Arrival Date.
-
#min_elec_amps(val) ⇒ Object
hookup: Electric Hookup.
-
#min_equip_length(val) ⇒ Object
eqplen: Equipment Length.
-
#nights(amt) ⇒ Object
lengthOfStay: Length of Stay.
-
#people(amt) ⇒ Object
Maxpeople: Number of campers.
-
#site_type(name) ⇒ Object
siteType.
Methods inherited from Abstract
#endpoint, #initialize, #query, #response, search, #search
Constructor Details
This class inherits a constructor from Supercamp::Criteria::Abstract
Instance Method Details
#arrival(date) ⇒ Object
arvdate: Arrival Date
The date in which the camper wants to start camping in mm/dd/yyyy format.
49 50 51 52 |
# File 'lib/supercamp/criteria/campsite.rb', line 49 def arrival(date) merge_option(:arvdate, date) self end |
#min_elec_amps(val) ⇒ Object
hookup: Electric Hookup
89 90 91 92 93 |
# File 'lib/supercamp/criteria/campsite.rb', line 89 def min_elec_amps(val) code = ELECTRIC_HOOKUPS.fetch(val.to_s) merge_option(:hookup, code) self end |
#min_equip_length(val) ⇒ Object
eqplen: Equipment Length
If the camper wants to find campgrounds where his 50 foot RV will fit, issue a query where eqplen=50
71 72 73 74 |
# File 'lib/supercamp/criteria/campsite.rb', line 71 def min_equip_length(val) merge_option("eqplen", val) self end |
#nights(amt) ⇒ Object
lengthOfStay: Length of Stay
When combined with arvdate, this parameter determines how long the camper would like to reserve the campground.
60 61 62 63 |
# File 'lib/supercamp/criteria/campsite.rb', line 60 def nights(amt) merge_option("lengthOfStay", amt) self end |
#people(amt) ⇒ Object
Maxpeople: Number of campers
80 81 82 83 |
# File 'lib/supercamp/criteria/campsite.rb', line 80 def people(amt) merge_option("Maxpeople", amt) self end |
#site_type(name) ⇒ Object
siteType
If unspecified, all site types are returned.
38 39 40 41 42 |
# File 'lib/supercamp/criteria/campsite.rb', line 38 def site_type(name) code = TYPES.fetch(name.to_s) merge_option("siteType", code) self end |