linkedin2 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 784a2b1e59ee322da6d88c34dff578b289cee1fb
4
- data.tar.gz: db782934e02027cc081125b672f8ab548140ab08
3
+ metadata.gz: f1aea99913577ebbafd1a9f3eb9847372694a75a
4
+ data.tar.gz: 379bde12e9a1a22b9fa78d47f2dfc7ff4af6c2d1
5
5
  SHA512:
6
- metadata.gz: bae1dc38a2d8df7845ad36cbbaa307e5c9cdc18fdebe7d2d063637d246221356ab24f17b9957ffbeeec134e054f4df76833dfd34db1d06b25f99bc1efbaca673
7
- data.tar.gz: e74e9381cb02ce3706335904e583860f921f120486ac9fbe2a129341d353e14823885846f768e72d6f9b00e5b4ce21dae39df4a468b0688270f2a98546f9a2d5
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: 'Non-Profit Organization Management' },
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' },
@@ -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].to_s.downcase == description.to_s.downcase }
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
@@ -1,3 +1,3 @@
1
1
  module LinkedIn
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
  end
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.13
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 00:00:00.000000000 Z
12
+ date: 2014-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2