Skip to content

Instantly share code, notes, and snippets.

@gotjosh
Created Jan 18, 2011
Embed
What would you like to do?
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