Class: LinkedIn::Base
- Inherits:
-
Object
- Object
- LinkedIn::Base
- Extended by:
- Forwardable
- Defined in:
- lib/linked_in/base.rb
Constant Summary collapse
- API_VERSION =
'v1'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#connections(lookup = nil, fields = nil, query = {}) ⇒ Object
Query options: start=N, count=N.
- #current_status(update) ⇒ Object
-
#initialize(client) ⇒ Base
constructor
A new instance of Base.
- #network(query = {}) ⇒ Object
-
#people(query = {}) ⇒ Object
Query options: start=N, count=N.
-
#person_activities(update, timestamp = nil) ⇒ Object
update is something like: ‘<a href="www.linkedin.com/profile?viewProfile=&key=ABCDEFG">Richard Brautigan</a> is reading about<a href="www.tigers.com">Tigers</a>http://www.tigers.com>Tigers</a>.’}.
-
#profile(lookup = nil, fields = nil, query = {}) ⇒ Object
Lookup Options: url=<public profile URL>, id=<member id> Field Options: :full.
Constructor Details
#initialize(client) ⇒ Base
Returns a new instance of Base.
10 11 12 |
# File 'lib/linked_in/base.rb', line 10 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/linked_in/base.rb', line 8 def client @client end |
Instance Method Details
#connections(lookup = nil, fields = nil, query = {}) ⇒ Object
Query options: start=N, count=N
28 29 30 31 |
# File 'lib/linked_in/base.rb', line 28 def connections(lookup = nil, fields = nil, query = {}) path = profile_path('connections', lookup, fields) perform_get(path, :query => query) end |
#current_status(update) ⇒ Object
38 39 40 41 42 |
# File 'lib/linked_in/base.rb', line 38 def current_status(update) path = profile_path('current-status') update_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><current-status>#{update}</current-status>" perform_put(path, :body => update_xml) end |
#network(query = {}) ⇒ Object
33 34 35 36 |
# File 'lib/linked_in/base.rb', line 33 def network(query = {}) path = profile_path('network') perform_get(path, :query => query) end |
#people(query = {}) ⇒ Object
Query options: start=N, count=N
22 23 24 25 |
# File 'lib/linked_in/base.rb', line 22 def people(query = {}) path = api_path('people') perform_get(path, query) end |
#person_activities(update, timestamp = nil) ⇒ Object
update is something like: ‘<a href="www.linkedin.com/profile?viewProfile=&key=ABCDEFG">Richard Brautigan</a> is reading about<a href="www.tigers.com">Tigers</a>http://www.tigers.com>Tigers</a>.’}
45 46 47 48 49 50 51 52 53 |
# File 'lib/linked_in/base.rb', line 45 def person_activities(update, = nil) path = profile_path('person-activities') body = {'activity' => { 'timestamp' => ( || Time.now.to_i), 'content-type' => 'linkedin-html', 'body' => update} } perform_post(path, body) end |
#profile(lookup = nil, fields = nil, query = {}) ⇒ Object
Lookup Options: url=<public profile URL>, id=<member id> Field Options: :full
16 17 18 19 |
# File 'lib/linked_in/base.rb', line 16 def profile(lookup = nil, fields = nil, query = {}) path = profile_path(nil, lookup, fields) perform_get(path, :query => query) end |