Class: CivicAide::Representatives

Inherits:
Object
  • Object
show all
Defined in:
lib/civic_aide/representatives.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Representatives

Returns a new instance of Representatives.



5
6
7
8
# File 'lib/civic_aide/representatives.rb', line 5

def initialize(client)
  @client = client
  @include_offices = true
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



3
4
5
# File 'lib/civic_aide/representatives.rb', line 3

def client
  @client
end

#include_officesObject (readonly)

Returns the value of attribute include_offices.



3
4
5
# File 'lib/civic_aide/representatives.rb', line 3

def include_offices
  @include_offices
end

Instance Method Details

#at(address) ⇒ Object



10
11
12
13
# File 'lib/civic_aide/representatives.rb', line 10

def at(address)
  response = client.post("/representatives/lookup", {includeOffices: @include_offices}, {:address => address})
  response.except!(:kind, :status)
end