wolas_channel 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ad159ec4acd5e1fa0f357a2160848dc651525f8
4
- data.tar.gz: 268d8324e8ede3207fcda9a549e764238aa63bd4
3
+ metadata.gz: 586eabc312bcd92cd8ba2f5ac3ba7c9d6bb49c04
4
+ data.tar.gz: b6b1b0ee16699308c1730738d96f6b46ebb737cf
5
5
  SHA512:
6
- metadata.gz: dc09ceb2f397fbf6b758a50b349b410a70d9d99a355c4d2a5f77d58f5eaa2fea9adad49af055404947d35e720db01876b535f2073b782be1d89db03680687790
7
- data.tar.gz: c5f3c9d7d7ba8b95c0672b6f9dfaa3b8a8bfcb94ecc2de51886f6d8ec0b3449b063e5eaa9e2245aa118c5e9c2e10aed502ea9f84096b729545a8ac687b80173b
6
+ metadata.gz: 181b9c498d7344d1e59e2d87bf0044df81b123e13d752c48a6763a8572f8e345b7de3305fcb413eee39458779eb95a995642b74bd7566fd15e3ac943c3024954
7
+ data.tar.gz: c60ae3a3f0ac7e9c9d790657dbca0ac618afabfe6585a00405af5e0920a40dc2e4ff6b45b90760f46dfff6e78f6d8752b1dec43df6f1d9c1f3f1c55d868e0660
@@ -42,6 +42,31 @@ class WolasChannel
42
42
  end
43
43
  end
44
44
 
45
+ # This method allows a tenant to return the name of channels, based on ids
46
+ def return_channel(*channel_ids)
47
+ begin
48
+ # Connect to the database
49
+ @connect = Connection.new.open
50
+ # Determine if the tenant has access to all channels requested
51
+ channel_ids.each do |channel_id|
52
+ tenant_channel(channel_id)
53
+ end
54
+
55
+ q_marks = in_prepare(channel_ids)
56
+
57
+ query = "SELECT `channels`.`channel_id`, `channels`.`type` FROM `channel`.`channels` \
58
+ WHERE `channels`.`channel_id` IN (#{q_marks})"
59
+ # This method performs the insert. Mysql2 does not return an object on a successful
60
+ # insert
61
+ result = prepare_exe(@connect, query, *channel_ids)
62
+
63
+ res = result.each { |r| r }
64
+ return res
65
+ ensure
66
+ @connect.close
67
+ end
68
+ end
69
+
45
70
  # This method returns an entity based off an id. If the channel id of the
46
71
  # entity does not match that of the tenant making the request, an error is raised
47
72
  def get_entity(entity_id)
@@ -1,3 +1,3 @@
1
1
  class WolasChannel
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolas_channel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - WOLAS
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-06 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler