Created
January 18, 2011 21:42
-
-
Save gotjosh/785209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BookingInformation | |
# attr_accessor :property,:children,:adults,:checkin,:checkout | |
def initialize(property,children,adults,checkin,checkout,lan) | |
@property = property | |
@children = children | |
@adults = adults | |
@checkin = checkin | |
@checkout = checkout | |
@lan = lan | |
@base_url = 'https://heregoesabaseurl?' | |
end | |
def output_url | |
case @property | |
when 'Golden Bear Lodge' then | |
property_id = '00000' | |
chain_id = '00000' | |
when 'Caleton Villas' then | |
property_id = '00000' | |
chain_id = '00000' | |
when 'Vista Mare' then | |
property_id = '00000' | |
chain_id = '00000' | |
end | |
url = "#{@base_url}Hotel=#{property_id}&Chain=#{chain_id}&arrive=#{@checkin}&depart=#{@checkout}&Adult=#{@adults}&Child=#{@adults}" | |
if @lan == 'en' # Dependns on language | |
url+= '&language=US' | |
end | |
url.squeeze(" ").strip | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment