bwapi 11.0.1.pre.612 → 11.0.1.pre.615

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDAwOWEwN2JkNjBkMGU0ZGZlNWExZDRkZDM3NjM1NzFjYjU0MjZhNA==
4
+ MWQ5N2E2NmVhYjU2MTY3NzZkYjY2OTMzMzdjN2YyZTZhNzE5YTdmMQ==
5
5
  data.tar.gz: !binary |-
6
- MDA4NGIxMTJjMGRjNzQzOTJhMDZiN2JkMDQxMDdmNmNlNmQzMzRjZQ==
6
+ YWYwMmRiNjlkZTQyMjM2MWQ3ZDg2ODlkNzY1ZjU2NjhkZDczZmRkMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDRlNTcxY2EwYmM5NTg4ZTg3MGQxZTQyNGMzY2VjMzdmODdiZTJmOWNhYWY1
10
- MjkwZDg4ZGNlYmYwYTE3ZjYxMDlhZTc3ZDM3OTM1YzFkYTRmOTU0MzcwYTMy
11
- OTc2OTAyZjNiYmQ3N2U5ZmQwYTBkMWU2MDEzNjgyMjA5NWYwOTg=
9
+ YTg1NDA1YzkzNmE5OWQwZjAxZjBiNzdlOWVjZWIwMTQ0NzUzOGU2NzgxYTZh
10
+ Mzg4MDQyMzhjYzgxMTc1OTg1YzM0OWFiZTJiOTQ5NTlkYTY3NjRmYTVmYjJk
11
+ NjI4NDE0ZjhjOTVmNzhjNmVkZWY1NjJhMThhMDkxNmQ5NWMwYjQ=
12
12
  data.tar.gz: !binary |-
13
- NjUwYTNjOWNiNWY3YmJmZGM2NGY4MGRmMzM4MzUyOTZjN2ZhYTIzYjU1Mjhk
14
- ZTg2N2JmODdkZTM3YmY0MjZiNjhhYzUwNzFiNmMyNWM1NTIyZDMzZjZiZWE4
15
- MzlhZDk0NDAzZDlmMzRmNDYwNTlkNzM3ZDVjNDVhZjU2ZTc2MDA=
13
+ OGU0YjE2OTUyYTA2Njk3ODk3OWUzODlkN2Y1YmU4MDZiZjM2Y2JiZTg4Zjgw
14
+ OTNlMWYzZDg2M2RiMDhjNmYyZjhiMWJiMzIwMWJhZDdlODgxMTczN2YwZjIy
15
+ ZjY3MDMxODM5NWQyY2M5OTJjOWEwZWEyMGViYTdiNTlmNDkwZDU=
data/lib/bwapi/client.rb CHANGED
@@ -96,6 +96,13 @@ module BWAPI
96
96
  @client_id == 'brandwatch-api-client' ? true : false
97
97
  end
98
98
 
99
+ # Check if user is a brandwatch-api-superadmin-client type
100
+ #
101
+ # @return [Boolean] Application client status
102
+ def api_super_admin_client?
103
+ @client_id == 'brandwatch-api-superadmin-client' ? true : false
104
+ end
105
+
99
106
  def access_token=(value)
100
107
  reset_connection
101
108
  @access_token = value
@@ -64,6 +64,17 @@ describe BWAPI::Client do
64
64
  end
65
65
  end
66
66
 
67
+ describe '.api_super_admin_client?' do
68
+ it 'returns true when client is a brandwatch-api-superadmin-client' do
69
+ bw = BWAPI::Client.new client_id: 'brandwatch-api-superadmin-client'
70
+ expect(bw.api_super_admin_client?).to eql(true)
71
+ end
72
+
73
+ it 'returns false when a client is not a brandwatch-api-superadmin-client' do
74
+ expect(BWAPI::Client.new.api_super_admin_client?).to eql(false)
75
+ end
76
+ end
77
+
67
78
  describe '.seconds_until_access_token_expires' do
68
79
  it 'should return the number of seconds until the access token expires' do
69
80
  bw = BWAPI::Client.new access_token_expiry: (Time.now + 3600).iso8601
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bwapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.1.pre.612
4
+ version: 11.0.1.pre.615
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Chrisp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-03 00:00:00.000000000 Z
11
+ date: 2015-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec