-
-
Save pazaricha/24430ce0bee84bc4f29054f3c97a25fa 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 FlightManager | |
def self.search(search_criteria) | |
provider = search_criteria[:provider].camelize | |
flights = "FlightProviders::#{provider}".constantize.search_flights(search_criteria) | |
"FilghtsResponseAdapter::#{provider}".constantize.normazlize(flights) | |
end | |
end | |
## Have one of these for each unique provider/response | |
module FilghtsResponseAdapter | |
class AlAlReponseAdapter | |
def self.normalize(flights_arr) | |
## Enter custom here to normalize data for this specific provider | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment