get-your-rep 1.0.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/get-your-rep.rb +1 -0
- data/lib/get-your-rep/delegation.rb +6 -6
- data/lib/get-your-rep/patches.rb +16 -0
- metadata +23 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 525f29909bf1690e4fe35ca0b23571e9e5aa2c1d
|
4
|
+
data.tar.gz: d6378420bd8bf41840d5b91764474146a721fcae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 286fc80f857728c5180ad4547aa072123ea10ead4eaff9c97b5ec58f81e0f841b04bdea0bdfa5468b0f7902a3bc5574fbc8891fef86592f3928649b58cc57bcf
|
7
|
+
data.tar.gz: 7af1318a9327e8d8d3245672247f4102dcba9693c8d49ef81b9d10c1b5c702e4e243b0963933a525d8c69a2f1fa0f7d5882bbb6ad7c7a728922c9e45bb0defd6
|
data/lib/get-your-rep.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# require 'pry'
|
2
2
|
require 'httparty'
|
3
3
|
require_relative 'get-your-rep/delegation.rb'
|
4
|
+
require_relative 'get-your-rep/patches.rb'
|
4
5
|
|
5
6
|
# The GetYourRep class has a collection of class methods that retrieve your elected representatives
|
6
7
|
# from the Google Civic Information API, parse it from JSON, and assemble it into a usable
|
@@ -10,6 +10,11 @@ class Delegation < Array
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
+
# Overloads the + operator to return a new Delegation instead of an Array.
|
14
|
+
def +(value)
|
15
|
+
Delegation.new(super)
|
16
|
+
end
|
17
|
+
|
13
18
|
# Collects the first names of every rep in the Delegation.
|
14
19
|
def first_names
|
15
20
|
self.map { |rep| rep[:name].split[0..-2].join(' ')}
|
@@ -28,12 +33,7 @@ class Delegation < Array
|
|
28
33
|
card[i] = []
|
29
34
|
rep.each do |key, value|
|
30
35
|
next if value.nil?
|
31
|
-
|
32
|
-
when :facebook
|
33
|
-
card[i] << "#{key.to_s.capitalize}: #{value}"
|
34
|
-
when :twitter
|
35
|
-
card[i] << "#{key.to_s.capitalize}: #{value}"
|
36
|
-
when :youtube
|
36
|
+
if key == :facebook || key == :twitter || key == :youtube || key == :googleplus
|
37
37
|
card[i] << "#{key.to_s.capitalize}: #{value}"
|
38
38
|
else
|
39
39
|
card[i] << "#{value}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: get-your-rep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- msimonborg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -38,6 +38,26 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.10'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 5.10.1
|
51
|
+
type: :development
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '5.10'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 5.10.1
|
41
61
|
description: Get your rep with Google's Civic Information API using your address and
|
42
62
|
API key.
|
43
63
|
email: msimonborg@gmail.com
|
@@ -47,6 +67,7 @@ extra_rdoc_files: []
|
|
47
67
|
files:
|
48
68
|
- lib/get-your-rep.rb
|
49
69
|
- lib/get-your-rep/delegation.rb
|
70
|
+
- lib/get-your-rep/patches.rb
|
50
71
|
homepage: https://github.com/msimonborg/get-your-rep
|
51
72
|
licenses:
|
52
73
|
- MIT
|