Skip to content

Instantly share code, notes, and snippets.

@christianromney
Created July 31, 2008 15:07
Show Gist options
  • Save christianromney/3453 to your computer and use it in GitHub Desktop.
Save christianromney/3453 to your computer and use it in GitHub Desktop.
# Only fixes the structural stupidity, not the retardedness
# of the underlying method of package finding
def get_cruise_package(cruise_package_code)
returning(package = nil) do |pack|
[
:getPreHotelPackage, :getPostHotelPackage, :getShorexPackage,
:getPreTransfersPackage, :getPostTransfersPackage, getMotorcoachPackage
].detect do |find_by_package_type|
pack = send(find_by_package_type, cruise_package_code)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment