cognition 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cognition/message.rb +2 -2
- data/lib/cognition/version.rb +1 -1
- data/test/test_message.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d830169bf46e5d46d3a405eacf69b5d4a7701046
|
4
|
+
data.tar.gz: 2193e7f57a5ab8f558a09455970c8b0bbc26a364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67846e449b3b3e2f4edb693ea3cdb779a40c54b820f659b6c033dd11d9e317d91ae65377175e9066914f95452b834c3b32c67b4fa7e69ce2ea2045996e6d469b
|
7
|
+
data.tar.gz: 60764cd759ba2afa744be491655efbf73f068b0851ab647d84fe6e550102959aa8dff3140cd375d7b573edb23106d9189a29907bc57ec983685da1c54486ab43
|
data/lib/cognition/message.rb
CHANGED
@@ -5,11 +5,11 @@ module Cognition
|
|
5
5
|
def initialize(command, metadata = {})
|
6
6
|
@command = command
|
7
7
|
@metadata = metadata
|
8
|
-
@responder = Cognition::Responder.new(metadata[
|
8
|
+
@responder = Cognition::Responder.new(metadata['callback_url']) if metadata['callback_url']
|
9
9
|
end
|
10
10
|
|
11
11
|
def reply(text)
|
12
|
-
return
|
12
|
+
return 'No Callback URL provided' unless @responder
|
13
13
|
@responder.reply(text)
|
14
14
|
end
|
15
15
|
end
|
data/lib/cognition/version.rb
CHANGED
data/test/test_message.rb
CHANGED
@@ -9,7 +9,7 @@ class CognitionTest < Minitest::Test
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def test_sets_responder_if_callback_url
|
12
|
-
msg = Cognition::Message.new('ping', callback_url
|
12
|
+
msg = Cognition::Message.new('ping', 'callback_url' => 'http://foo.bar/')
|
13
13
|
assert_kind_of Cognition::Responder, msg.responder
|
14
14
|
end
|
15
15
|
|