wit_bot 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wit_bot/models/wit/entity/entity_model.rb +8 -6
- data/lib/wit_bot/version.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: c1b7c52f2b1b3dcb990efec623c7b8937d070863
|
4
|
+
data.tar.gz: c4fac73cffe1125374cfd876f4cbae198b2fcd00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 658ca8a99ce362a44beb1d233b1df2c6ee30e1ea0fbe27d002526af4f12c8b287fd258ba060c7b2db7ef8972dede09be7b9a16457df1bc285c24da2114d8961b
|
7
|
+
data.tar.gz: 2fe302edf51fe1bde5c5e1f5d6b719b11314b83fb58771b7575a873a200729ef0ab7c0494f92f088e2a74b0605ce08c5ff07b49faa80a4cfcc1f4d4d99ee38f8
|
@@ -5,17 +5,19 @@ module WitBot
|
|
5
5
|
def initialize(raw_entities)
|
6
6
|
@raw = raw_entities
|
7
7
|
|
8
|
-
super Hash[
|
9
|
-
all = all.map
|
8
|
+
super Hash[raw_entities.map do |(role, all)|
|
9
|
+
all = all.map do |data|
|
10
|
+
entity_name = data[:entity] || role
|
11
|
+
entity = WitModel::Entity.find(entity_name, create: false)
|
12
|
+
entity.model role, data
|
13
|
+
end
|
10
14
|
|
11
|
-
data = all.first
|
12
|
-
|
13
|
-
data.all = all
|
15
|
+
data = all.length == 1 ? all.first : all
|
14
16
|
|
15
17
|
create_getter role
|
16
18
|
|
17
19
|
[role, data]
|
18
|
-
end
|
20
|
+
end]
|
19
21
|
end
|
20
22
|
|
21
23
|
def method_missing(*_)
|
data/lib/wit_bot/version.rb
CHANGED