converse 1.0.21 → 1.0.22
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/converse/interaction.rb +30 -1
- data/lib/converse/version.rb +1 -1
- metadata +4 -4
data/lib/converse/interaction.rb
CHANGED
@@ -10,6 +10,12 @@ module Converse
|
|
10
10
|
attr_accessor :conversation
|
11
11
|
attr_accessor :should_i_ask
|
12
12
|
|
13
|
+
private
|
14
|
+
|
15
|
+
@validation
|
16
|
+
|
17
|
+
public
|
18
|
+
|
13
19
|
def discuss_with_broker_concerning(broker, concern)
|
14
20
|
discuss_with(broker)
|
15
21
|
concerning(concern)
|
@@ -101,5 +107,28 @@ module Converse
|
|
101
107
|
def interpret_conversation(response)
|
102
108
|
response
|
103
109
|
end
|
110
|
+
|
111
|
+
def ensure_that(substance)
|
112
|
+
@validation = substance
|
113
|
+
self
|
114
|
+
end
|
115
|
+
|
116
|
+
def includes(keys)
|
117
|
+
raise ArgumentError, "No arguments provided for this interaction and it requires #{keys}" if @validation.nil?
|
118
|
+
|
119
|
+
if @validation.kind_of?(Hash)
|
120
|
+
keys.each do |k|
|
121
|
+
raise ArgumentError, "#{k} must be provided for this interaction" if not @validation.has_key?(k)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
def does_not_include(keys)
|
127
|
+
if @validation.kind_of?(Hash)
|
128
|
+
keys.each do |k|
|
129
|
+
raise ArgumentError, "#{key} is invalid for this interaction" if @validation.has_key?(k)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
104
133
|
end
|
105
|
-
end
|
134
|
+
end
|
data/lib/converse/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: converse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 22
|
10
|
+
version: 1.0.22
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ernst van Graan
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-10-
|
18
|
+
date: 2012-10-30 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: Converse provides Broker/Translator classes to facilitate communication across an API by means of conversations
|