Created
January 23, 2020 16:21
-
-
Save akwiatkowski/5eb1cfe54a90f9009871b5f80d21c7e3 to your computer and use it in GitHub Desktop.
Very initial metar fetcher service (task)
This file contains hidden or 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 MetarFetcher | |
def fetch(city = "EPPO") | |
html = get_http(city) | |
data = process_response(html) | |
data | |
end | |
private | |
def get_http(city) | |
html = "<html>..." | |
html | |
end | |
def process_response(html) | |
{ | |
city: "EPPO", | |
time: Time.now, | |
temperature: 2 | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment