linkedin2 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/linkedin/api/industries.rb +1 -25
- data/lib/linkedin/industry.rb +11 -1
- data/lib/linkedin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1aea99913577ebbafd1a9f3eb9847372694a75a
|
4
|
+
data.tar.gz: 379bde12e9a1a22b9fa78d47f2dfc7ff4af6c2d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 239f629f4d689d614f569a2fb1f578838ea41e5aafd354abe0a0a4bd735db3320c2a22f6b7923ada06c48df292d83cc6149e8ffdad30f97210db1addab31fd6a
|
7
|
+
data.tar.gz: 4fc120b83dc38378fbff4eaa64171da89246d81a31d569be0b6209dc3dbe0d1f3e67f2c0e0157fcb3b418b76818a222cfcbb46f9a3f272c50293ac46c442db11
|
@@ -1,30 +1,6 @@
|
|
1
1
|
module LinkedIn
|
2
2
|
module API
|
3
3
|
module Industries
|
4
|
-
def self.all
|
5
|
-
INDUSTRIES
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.[](code)
|
9
|
-
find_by_code(code)
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.find_by_code(code)
|
13
|
-
INDUSTRIES.detect { |indust| indust[:code] == code }
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.find_by_group(*groups)
|
17
|
-
INDUSTRIES.reject { |indust| (groups & indust[:group]) != groups }
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.find_by_description(description)
|
21
|
-
INDUSTRIES.detect { |indust| indust[:description].to_s.downcase == description.to_s.downcase }
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.find_group_names(*groups)
|
25
|
-
Array[groups].flatten.map { |group| GROUPS[group.to_sym] }
|
26
|
-
end
|
27
|
-
|
28
4
|
INDUSTRIES = [ { code: 1, group: [:gov, :tech], description: 'Defense & Space' },
|
29
5
|
{ code: 3, group: [:tech], description: 'Computer Hardware' },
|
30
6
|
{ code: 4, group: [:tech], description: 'Computer Software' },
|
@@ -123,7 +99,7 @@ module LinkedIn
|
|
123
99
|
{ code: 97, group: [:corp], description: 'Market Research' },
|
124
100
|
{ code: 98, group: [:corp], description: 'Public Relations and Communications' },
|
125
101
|
{ code: 99, group: [:art, :med], description: 'Design' },
|
126
|
-
{ code: 100, group: [:org], description: '
|
102
|
+
{ code: 100, group: [:org], description: 'Nonprofit Organization Management' },
|
127
103
|
{ code: 101, group: [:org], description: 'Fund-Raising' },
|
128
104
|
{ code: 102, group: [:corp, :org], description: 'Program Development' },
|
129
105
|
{ code: 103, group: [:art, :med, :rec], description: 'Writing and Editing' },
|
data/lib/linkedin/industry.rb
CHANGED
@@ -17,7 +17,17 @@ module LinkedIn
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.find_by_description(description)
|
20
|
-
all.detect { |indust| indust[:description]
|
20
|
+
all.detect { |indust| normalize_description(indust[:description]) == normalize_description(description) }
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.find_group_names(*groups)
|
24
|
+
Array[groups].flatten.map { |group| LinkedIn::API::Industries::GROUPS[group.to_sym] }
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def self.normalize_description(description)
|
30
|
+
description.to_s.downcase.strip.gsub(' ','_').gsub(/[^\w]/, '').to_sym
|
21
31
|
end
|
22
32
|
end
|
23
33
|
end
|
data/lib/linkedin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linkedin2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Breznak
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-05-
|
12
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|