apiotics 0.1.67 → 0.1.68
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apiotics/portal.rb +40 -36
- data/lib/apiotics/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: b473a8358e708bfb40ab3b936f13b5cc570187bb
|
4
|
+
data.tar.gz: 2dfd0a46fde8496e8d25f4cca997033ae33b79df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08ced548439143220604f11e197cb064e07e1759478275a6f31fa21a6729561be18e9f8adae3b35a92e129d1ba8cdee32456a35ab9975869fc04d3e6c5d218e2
|
7
|
+
data.tar.gz: cc9acdee24064f6279be224d208e4349ea15f6934d5dc24fcca1ae33bc9366fd47397dbc9b9b8389b9896ed3985f0ac2ffe3e22f7f4abd03efb096dae9fe2ed9
|
data/lib/apiotics/portal.rb
CHANGED
@@ -12,43 +12,47 @@ module Apiotics
|
|
12
12
|
|
13
13
|
def self.parse_drivers_and_scripts(hash, parent_name, model_name)
|
14
14
|
attributes_hash = nil
|
15
|
-
hash["workers"][parent_name]["drivers"]
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
15
|
+
if hash["workers"][parent_name]["drivers"] != nil
|
16
|
+
hash["workers"][parent_name]["drivers"].each do |k,v|
|
17
|
+
name = v["metadata"]["common name"].classify
|
18
|
+
if name == model_name.classify
|
19
|
+
attributes_hash = Hash.new
|
20
|
+
attributes_hash[:kind] = "driver"
|
21
|
+
attributes_hash[:attributes] = Hash.new
|
22
|
+
v["interfaces"].each do |k,v|
|
23
|
+
attributes_hash[:attributes][k] = {
|
24
|
+
type: v["type"],
|
25
|
+
accessor: v["accessor type"],
|
26
|
+
units: v["units"],
|
27
|
+
noise: v["noise threshold"],
|
28
|
+
values: v["values"],
|
29
|
+
range: v["range"]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
32
34
|
end
|
33
|
-
hash["workers"][parent_name]["scripts"]
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
35
|
+
if hash["workers"][parent_name]["scripts"] != nil
|
36
|
+
hash["workers"][parent_name]["scripts"].each do |k,v|
|
37
|
+
name = v["metadata"]["common name"].classify
|
38
|
+
if name == model_name.classify
|
39
|
+
attributes_hash = Hash.new
|
40
|
+
attributes_hash[:kind] = "script"
|
41
|
+
attributes_hash[:attributes] = Hash.new
|
42
|
+
v["interfaces"].each do |key,value|
|
43
|
+
attributes_hash[:attributes][key] = {
|
44
|
+
type: value["type"],
|
45
|
+
accessor: value["accessor type"],
|
46
|
+
units: value["units"],
|
47
|
+
noise: value["noise threshold"],
|
48
|
+
values: value["values"],
|
49
|
+
range: value["range"]
|
50
|
+
}
|
51
|
+
end
|
52
|
+
attributes_hash[:inputs] = Hash.new
|
53
|
+
v["inputs"].each do |key,value|
|
54
|
+
attributes_hash[:inputs][key] = value
|
55
|
+
end
|
52
56
|
end
|
53
57
|
end
|
54
58
|
end
|
data/lib/apiotics/version.rb
CHANGED