pyr 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cd5d4b0396c09ef15ce17149ddc2630c0a7be0b
4
- data.tar.gz: 23862f7073f6ce87b2d4b7dd499ba69484c55eba
3
+ metadata.gz: 4c927358cc195c550b23e1ec8ff2acf3c0e53c6e
4
+ data.tar.gz: 38a39b3a5a401a2d08bf6bd1276b4403f0664579
5
5
  SHA512:
6
- metadata.gz: 9ed8f194ac9d6a9f7da98603875a19a4a96adb6107b3e7b04954f1289fb28e0f0691507bfd3f43a2cbe3dd6f4bc94ea432c13ae7f859a0ca4a43b04b8ac79093
7
- data.tar.gz: ccca4b7c35d5995d5d888418f204b5bbbd9392ce350b18d45ce4e5ef914e3fb0124ae767d647f4e82c65395d1b0c4cdc99fe7b7b63517c855e856ce5b2eb964a
6
+ metadata.gz: 481552f67f2f856b9772bc4ba1587eb401638e359e2156d738f60fdc7f974d6999e5f0f53d6ec192f27861c3432bbaa2a2fd88c936e481b2cb752bbf90f11618
7
+ data.tar.gz: cbe89a672721ad2c7e3bebb99018bffd07a929320de648147292d01aba2dfdd8bda273dbfe42239e351aa5863eb465c02da145e19a174719534d58d4855779a0
@@ -5,6 +5,126 @@ module PYR
5
5
  # Resource object for sending requests to the /reps resource of the API
6
6
  class Reps < Resource
7
7
  include GeoFindable
8
+
9
+ # Read the state param
10
+ attr_reader :state
11
+
12
+ # Read the district param
13
+ attr_reader :district
14
+
15
+ # Read the party param
16
+ attr_reader :party
17
+
18
+ # Read the chamber param
19
+ attr_reader :chamber
20
+
21
+ # Set the state param. Can be the full name or two-letter abbreviation.
22
+ #
23
+ # @param name [String]
24
+ #
25
+ # @api public
26
+ #
27
+ # @example
28
+ # PYR.call :reps do |r|
29
+ # r.state = 'texas'
30
+ # end
31
+ # Resulting URI
32
+ # 'https://phone-your-rep.herokuapp.com/api/beta/reps?lat=45.0&long=-45.0'
33
+ def state=(name)
34
+ @state = Param.new(:state, name)
35
+ params << @state
36
+ end
37
+
38
+ # Set the district param. Accepts the two-digit district code or
39
+ # four-digit full code.
40
+ #
41
+ # @param code [String]
42
+ #
43
+ # @api public
44
+ #
45
+ # @example
46
+ # PYR.call :reps do |r|
47
+ # r.district = '5000'
48
+ # end
49
+ def district=(code)
50
+ @district = Param.new(:district, code)
51
+ params << @district
52
+ end
53
+
54
+ # Set the party param
55
+ #
56
+ # @param name [String]
57
+ #
58
+ # @api public
59
+ #
60
+ # @example
61
+ # PYR.call :reps do |r|
62
+ # r.party = 'democrat'
63
+ # end
64
+ def party=(name)
65
+ @party = Param.new(:party, name)
66
+ params << @party
67
+ end
68
+
69
+ # Set the chamber param
70
+ #
71
+ # @param chamber [String]
72
+ #
73
+ # @api public
74
+ #
75
+ # @example
76
+ # PYR.call :reps do |r|
77
+ # r.chamber = 'lower'
78
+ # end
79
+ def chamber=(chamber)
80
+ @chamber = Param.new(:chamber, chamber)
81
+ params << @chamber
82
+ end
83
+
84
+ # Set the independent boolean param
85
+ #
86
+ # @param boolean [Boolean]
87
+ #
88
+ # @api public
89
+ #
90
+ # @example
91
+ # PYR.call :reps do |r|
92
+ # r.independent = true
93
+ # end
94
+ def independent=(boolean)
95
+ @independent = Param.new(:independent, boolean)
96
+ params << @independent
97
+ end
98
+
99
+ # Set the republican boolean param
100
+ #
101
+ # @param boolean [Boolean]
102
+ #
103
+ # @api public
104
+ #
105
+ # @example
106
+ # PYR.call :reps do |r|
107
+ # r.republican = true
108
+ # end
109
+ def republican=(boolean)
110
+ @republican = Param.new(:republican, boolean)
111
+ params << @republican
112
+ end
113
+
114
+ # Set the democrat boolean param
115
+ #
116
+ # @param boolean [Boolean]
117
+ #
118
+ # @api public
119
+ #
120
+ # @example
121
+ # PYR.call :reps do |r|
122
+ # r.democrat = true
123
+ # end
124
+ def democrat=(boolean)
125
+ @democrat = Param.new(:democrat, boolean)
126
+ params << @democrat
127
+ end
8
128
  end
9
129
  end
10
130
  end
data/lib/pyr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PYR
4
- VERSION = '0.3.6' # :nodoc:
4
+ VERSION = '0.4.0' # :nodoc:
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. Simon Borg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-19 00:00:00.000000000 Z
11
+ date: 2017-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday