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 +4 -4
- data/lib/wolas_channel.rb +25 -0
- data/lib/wolas_channel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586eabc312bcd92cd8ba2f5ac3ba7c9d6bb49c04
|
4
|
+
data.tar.gz: b6b1b0ee16699308c1730738d96f6b46ebb737cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 181b9c498d7344d1e59e2d87bf0044df81b123e13d752c48a6763a8572f8e345b7de3305fcb413eee39458779eb95a995642b74bd7566fd15e3ac943c3024954
|
7
|
+
data.tar.gz: c60ae3a3f0ac7e9c9d790657dbca0ac618afabfe6585a00405af5e0920a40dc2e4ff6b45b90760f46dfff6e78f6d8752b1dec43df6f1d9c1f3f1c55d868e0660
|
data/lib/wolas_channel.rb
CHANGED
@@ -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)
|
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.
|
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-
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|