Sha256: 6ca10a6953fd07e0b7457d6bca04c9c0fc710e6c01f9d87c02e56a969d5a3c9e

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

module MobilizeAmericaClient
  class Client
    module Events
      def organization_events(organization_id:, timeslot_start: nil, timeslot_end: nil, updated_since: nil,
                              max_distance_miles: nil, page: nil, per_page: nil, zipcode: nil)
        params = {}

        unless page.nil?
          params[:page] = page
        end

        unless per_page.nil?
          params[:per_page] = per_page
        end

        unless timeslot_start.nil?
          params[:timeslot_start] = timeslot_start
        end

        unless timeslot_end.nil?
          params[:timeslot_end] = timeslot_end
        end

        unless updated_since.nil?
          params[:updated_since] = updated_since.to_i
        end

        unless zipcode.nil?
          params[:zipcode] = zipcode

          unless max_distance_miles.nil?
            params[:max_dist] = max_distance_miles
          end
        end

        get(path: "/organizations/#{esc(organization_id)}/events", params: params)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mobilize-america-client-0.3.4 lib/mobilize_america_client/client/events.rb