Class: CivicAide::Representatives
- Inherits:
-
Object
- Object
- CivicAide::Representatives
- Defined in:
- lib/civic_aide/representatives.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#include_offices ⇒ Object
readonly
Returns the value of attribute include_offices.
Instance Method Summary collapse
- #at(address) ⇒ Object
-
#initialize(client) ⇒ Representatives
constructor
A new instance of Representatives.
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
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/civic_aide/representatives.rb', line 3 def client @client end |
#include_offices ⇒ Object (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 |