Module: LinkedIn::Industries

Defined in:
lib/linkedin/industries.rb

Class Method Summary collapse

Class Method Details

.[](code) ⇒ Object



7
8
9
# File 'lib/linkedin/industries.rb', line 7

def self.[](code)
  find_by_code code
end

.allObject



3
4
5
# File 'lib/linkedin/industries.rb', line 3

def self.all
  LinkedIn::INDUSTRIES
end

.find_by_code(code) ⇒ Object



11
12
13
# File 'lib/linkedin/industries.rb', line 11

def self.find_by_code(code)
  all.detect { |indust| indust[:code] == code }
end

.find_by_description(description) ⇒ Object



19
20
21
# File 'lib/linkedin/industries.rb', line 19

def self.find_by_description(description)
  all.detect { |indust| normalize_description(indust[:description]) == normalize_description(description) }
end

.find_by_group(*groups) ⇒ Object



15
16
17
# File 'lib/linkedin/industries.rb', line 15

def self.find_by_group(*groups)
  all.reject { |indust| (groups & indust[:group]) != groups }
end

.find_group_names(*groups) ⇒ Object



23
24
25
# File 'lib/linkedin/industries.rb', line 23

def self.find_group_names(*groups)
  Array[groups].flatten.map { |group| LinkedIn::GROUPS[group.to_sym] }
end