Created
January 7, 2018 18:13
-
-
Save leenyburger/03b5cc708e06dd78200108605d4798b5 to your computer and use it in GitHub Desktop.
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 Meetup | |
| include HTTParty | |
| base_uri 'api.meetup.com' | |
| def get_data | |
| self.class.get('/operation-code-hampton-roads/events') | |
| end | |
| def events | |
| if get_data.code.to_i == 200 | |
| get_data.parsed_response | |
| else | |
| raise "Error fetching data from Meetup API" | |
| end | |
| end | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment