class MeetupOrbit::Client

Attributes

historical_import[RW]
meetup_urlname[RW]
orbit_api_key[RW]
orbit_workspace[RW]

Public Class Methods

new(params = {}) click to toggle source
# File lib/meetup_orbit/client.rb, line 36
def initialize(params = {})
  @orbit_api_key = params.fetch(:orbit_api_key, ENV["ORBIT_API_KEY"])
  @orbit_workspace = params.fetch(:orbit_workspace, ENV["ORBIT_WORKSPACE_ID"])
  @meetup_urlname = check_urlname(params.fetch(:meetup_urlname, ENV["MEETUP_URLNAME"]))
  @historical_import = params.fetch(:historical_import, false)
end

Public Instance Methods

event_rsvps() click to toggle source
# File lib/meetup_orbit/client.rb, line 43
def event_rsvps
  MeetupOrbit::Meetup.new(
    meetup_urlname: @meetup_urlname,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace,
    historical_import: @historical_import
  ).process_event_rsvps
end

Private Instance Methods

check_urlname(urlname) click to toggle source
# File lib/meetup_orbit/client.rb, line 54
def check_urlname(urlname)
  if urlname.start_with?("http://") || urlname.start_with?("https://") || urlname.start_with?("www") || urlname.start_with?("meetup.com")
    raise ArgumentError,
          "'meetup_urlname' parameter must only be the unique identifier of your meetup not the entire URL. Please refer to the README for more details."
  end

  urlname
end