Class: Plus::Activities
- Inherits:
-
Object
- Object
- Plus::Activities
- Defined in:
- lib/plus/activities.rb
Class Method Summary collapse
-
.get(activity_id, options = {}) ⇒ Object
Retrieves the detail for a given activity.
-
.list(user_id, options = {}) ⇒ Object
Retrieves the recent posts for a given user.
-
.search(query, options = {}) ⇒ Object
Searches public activities for the given search term.
Class Method Details
.get(activity_id, options = {}) ⇒ Object
Retrieves the detail for a given activity.
16 17 18 19 20 21 22 23 24 |
# File 'lib/plus/activities.rb', line 16 def self.get(activity_id, ={}) endpoint_prefix = 'activities' = { :alt => :json } = .merge() url = Plus::ENDPOINT + endpoint_prefix + '/' + activity_id HTTParty.get(url, :query => .merge(:key => Plus.[:api_key])) end |
.list(user_id, options = {}) ⇒ Object
Retrieves the recent posts for a given user.
5 6 7 8 9 10 11 12 13 |
# File 'lib/plus/activities.rb', line 5 def self.list(user_id, ={}) endpoint_prefix = 'people' = { :collection => :public, :alt => :json } = .merge() url = Plus::ENDPOINT + endpoint_prefix + '/' + user_id.to_s + '/activities/' + .delete(:collection).to_s HTTParty.get(url, :query => .merge(:key => Plus.[:api_key])) end |
.search(query, options = {}) ⇒ Object
Searches public activities for the given search term
27 28 29 30 31 32 33 34 35 |
# File 'lib/plus/activities.rb', line 27 def self.search(query, ={}) endpoint_prefix = 'activities' = { :alt => :json } = .merge() url = Plus::ENDPOINT + endpoint_prefix HTTParty.get(url, :query => .merge(:key => Plus.[:api_key], :query => query)) end |