Class: RMeetup::Client
- Inherits:
-
Object
- Object
- RMeetup::Client
- Defined in:
- lib/rmeetup.rb
Overview
RMeetup::Client
Essentially a simple wrapper to delegate requests to different fetcher classes who are responsible for fetching and parsing their own responses.
Constant Summary collapse
- FETCH_TYPES =
[:topics, :cities, :members, :rsvps, :events, :groups, :comments, :photos]
- @@api_key =
Meetup API Key Get one at www.meetup.com/meetup_api/key/ Needs to be the group organizers API Key to be able to RSVP for other people
nil
Class Method Summary collapse
Class Method Details
.api_key ⇒ Object
37 |
# File 'lib/rmeetup.rb', line 37 def self.api_key; @@api_key; end |
.api_key=(key) ⇒ Object
38 |
# File 'lib/rmeetup.rb', line 38 def self.api_key=(key); @@api_key = key; end |
.fetch(type, options = {}) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rmeetup.rb', line 40 def self.fetch(type, = {}) check_configuration! # Merge in all the standard options # Keeping whatever was passed in = .merge() if FETCH_TYPES.include?(type.to_sym) # Get the custom fetcher used to manage options, api call to get a type of response fetcher = RMeetup::Fetcher.for(type) return fetcher.fetch() else raise InvalidRequestTypeError.new(type) end end |