Class: PYR::Resource::Reps

Inherits:
PYR::Resource show all
Includes:
GeoFindable
Defined in:
lib/pyr/resources/reps.rb

Overview

Resource object for sending requests to the /reps resource of the API

Instance Attribute Summary collapse

Attributes included from GeoFindable

#address, #generate, #lat, #long

Attributes inherited from PYR::Resource

#controller, #id

Instance Method Summary collapse

Methods inherited from PYR::Resource

#initialize, #to_s

Constructor Details

This class inherits a constructor from PYR::Resource

Instance Attribute Details

#chamberObject

Read the chamber param



19
20
21
# File 'lib/pyr/resources/reps.rb', line 19

def chamber
  @chamber
end

#districtObject

Read the district param



13
14
15
# File 'lib/pyr/resources/reps.rb', line 13

def district
  @district
end

#partyObject

Read the party param



16
17
18
# File 'lib/pyr/resources/reps.rb', line 16

def party
  @party
end

#stateObject

Read the state param



10
11
12
# File 'lib/pyr/resources/reps.rb', line 10

def state
  @state
end

Instance Method Details

#democrat=(boolean) ⇒ Object

Set the democrat boolean param

Examples:

PYR.call :reps do |r|
  r.democrat = true
end

Parameters:

  • boolean (Boolean)


124
125
126
127
# File 'lib/pyr/resources/reps.rb', line 124

def democrat=(boolean)
  @democrat = Param.new(:democrat, boolean)
  params << @democrat
end

#independent=(boolean) ⇒ Object

Set the independent boolean param

Examples:

PYR.call :reps do |r|
  r.independent = true
end

Parameters:

  • boolean (Boolean)


94
95
96
97
# File 'lib/pyr/resources/reps.rb', line 94

def independent=(boolean)
  @independent = Param.new(:independent, boolean)
  params << @independent
end

#republican=(boolean) ⇒ Object

Set the republican boolean param

Examples:

PYR.call :reps do |r|
  r.republican = true
end

Parameters:

  • boolean (Boolean)


109
110
111
112
# File 'lib/pyr/resources/reps.rb', line 109

def republican=(boolean)
  @republican = Param.new(:republican, boolean)
  params << @republican
end