Module: LinkedIn::Search

Included in:
Client
Defined in:
lib/linked_in/search.rb

Instance Method Summary collapse

Instance Method Details

#search(options = {}, type = 'people') ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/linked_in/search.rb', line 4

def search(options={}, type='people')

  path = "/#{type.to_s}-search"

  if options.is_a?(Hash)
    fields = options.delete(:fields)
    path += field_selector(fields) if fields
  end

  options = { :keywords => options } if options.is_a?(String)
  options = format_options_for_query(options)

  result_json = get(to_uri(path, options))

  Mash.from_json(result_json)
end