google_plus 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,11 +8,17 @@ module GooglePlus
8
8
  extend GooglePlus::Resource
9
9
  include GooglePlus::Entity
10
10
 
11
- def self.get(activity_id)
12
- data = make_request(:get, "activities/#{activity_id}")
11
+ def self.get(activity_id, params = {})
12
+ data = make_request(:get, "activities/#{activity_id}", params)
13
13
  Activity.new(JSON.parse(data)) if data
14
14
  end
15
15
 
16
+ def self.search(query, params = {})
17
+ params[:query] = URI.escape(query)
18
+ resource = 'activities'
19
+ GooglePlus::Cursor.new(self, :get, resource, params)
20
+ end
21
+
16
22
  def self.for_person(user_id, params = {})
17
23
  collection = params[:collection] || :public
18
24
  resource = "people/#{user_id}/activities/#{collection}"
@@ -8,8 +8,8 @@ module GooglePlus
8
8
  extend GooglePlus::Resource
9
9
  include GooglePlus::Entity
10
10
 
11
- def self.get(comment_id)
12
- data = make_request(:get, "comments/#{comment_id}")
11
+ def self.get(comment_id, params = {})
12
+ data = make_request(:get, "comments/#{comment_id}", params)
13
13
  Comment.new(JSON.parse(data)) if data
14
14
  end
15
15
 
@@ -8,11 +8,17 @@ module GooglePlus
8
8
  extend GooglePlus::Resource
9
9
  include GooglePlus::Entity
10
10
 
11
- def self.get(user_id)
12
- data = make_request(:get, "people/#{user_id}")
11
+ def self.get(user_id, params = {})
12
+ data = make_request(:get, "people/#{user_id}", params)
13
13
  Person.new(JSON.parse(data)) if data
14
14
  end
15
15
 
16
+ def self.search(query, params = {})
17
+ params[:query] = URI.escape(query)
18
+ resource = 'people'
19
+ GooglePlus::Cursor.new(self, :get, resource, params)
20
+ end
21
+
16
22
  # get a cursor for activities for this user
17
23
  def list_activities
18
24
  GooglePlus::Activity.for_person(id)
@@ -1,5 +1,5 @@
1
1
  module GooglePlus
2
2
 
3
- VERSION = '0.0.4'
3
+ VERSION = '0.1.0'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
17
- requirement: &70279600675640 !ruby/object:Gem::Requirement
17
+ requirement: &70179188915680 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 2.6.0
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *70279600675640
25
+ version_requirements: *70179188915680
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rest-client
28
- requirement: &70279600675140 !ruby/object:Gem::Requirement
28
+ requirement: &70179188915180 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: 1.6.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70279600675140
36
+ version_requirements: *70179188915180
37
37
  description: Google+ Ruby Gem
38
38
  email: john.crepezzi@gmail.com
39
39
  executables: []