Sha256: 2b6d81fd219508e563cf928d4908e4e85344590abe07b37fd0285d33985c10c5

Contents?: true

Size: 467 Bytes

Versions: 4

Compression:

Stored size: 467 Bytes

Contents

module AgraApi
  class Signature < Base
    attr_accessor :petition_id

    def base_path
      "/petitions/#{petition_id}/signatures"
    end

    def find_by_email(email_address)
      begin
        response = client.get_request("#{normalized_base_path}/lookup", email: email_address)
        response.body
      rescue Vertebrae::ResponseError => e
        if e.status_code == 404
          nil
        else
          raise
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
agra_api-0.3.3 lib/agra_api/signature.rb
agra_api-0.3.2 lib/agra_api/signature.rb
agra_api-0.3.1 lib/agra_api/signature.rb
agra_api-0.3.0 lib/agra_api/signature.rb