Module: MCLI

Defined in:
lib/meetup-cli/api.rb,
lib/meetup-cli/version.rb

Constant Summary collapse

VERSION =
'2.0.0'

Class Method Summary collapse

Class Method Details

.get_didntgo_eventsObject



28
29
30
# File 'lib/meetup-cli/api.rb', line 28

def self.get_didntgo_events
  api = init_api.fetch(:events, {member_id: 'self', status: 'past', desc: 'true', rsvp: 'no'})
end

.get_going_eventsObject



12
13
14
# File 'lib/meetup-cli/api.rb', line 12

def self.get_going_events
  api = init_api.fetch(:events, {member_id: 'self', rsvp: 'yes'})
end

.get_notgoing_eventsObject



16
17
18
# File 'lib/meetup-cli/api.rb', line 16

def self.get_notgoing_events
  api = init_api.fetch(:events, {member_id: 'self', rsvp: 'no'})
end

.get_past_eventsObject



32
33
34
35
# File 'lib/meetup-cli/api.rb', line 32

def self.get_past_events
  # Unlike upcoming events, does not return valid results if 'rsvp' value is not explicitly specified
  api = init_api.fetch(:events, {member_id: 'self', status: 'past', desc: 'true', rsvp: 'yes,no'})
end

.get_upcoming_eventsObject



20
21
22
# File 'lib/meetup-cli/api.rb', line 20

def self.get_upcoming_events
  api = init_api.fetch(:events, {member_id: 'self'})
end

.get_went_eventsObject



24
25
26
# File 'lib/meetup-cli/api.rb', line 24

def self.get_went_events
  api = init_api.fetch(:events, {member_id: 'self', status: 'past', desc: 'true', rsvp: 'yes'})
end

.init_apiObject



4
5
6
7
8
# File 'lib/meetup-cli/api.rb', line 4

def self.init_api
  RMeetup::Client.new do |meetup_config|
    meetup_config.api_key = $config['api_key']
  end
end