Module: EzLinkedin::Search
- Included in:
- Client
- Defined in:
- lib/ezlinkedin/search.rb
Instance Method Summary collapse
-
#search(options, type = "people") ⇒ Mash
client.search(:people => [‘id’, ‘first-name’], fields: [‘num-results’], first_name: ‘bob’) client.search(:company => [‘id’, ‘name’], keywords: ‘stuff’).
Instance Method Details
#search(options, type = "people") ⇒ Mash
client.search(:people => [‘id’, ‘first-name’], fields: [‘num-results’], first_name: ‘bob’)
client.search(:company => ['id', 'name'], keywords: 'stuff')
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ezlinkedin/search.rb', line 17 def search(, type="people") path = "/#{type.to_s}-search" if .is_a?(Hash) if .has_key? :company type = 'company' end path = "/#{type.to_s}-search" if type_fields = .delete(type.to_sym) if type != 'people' path += ":(companies:(#{type_fields.join(',')})#{search_fields()})" else path += ":(people:(#{type_fields.join(',')})#{search_fields()})" end end path += configure_fields() elsif .is_a?(String) path += configure_fields({keywords: }) = {} end Mash.from_json(get(path, )) end |