lab-manager 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/lab_manager/configuration.rb +15 -9
- metadata +1 -1
@@ -1,17 +1,23 @@
|
|
1
|
+
require 'flexmock'
|
2
|
+
|
1
3
|
class Configuration
|
2
4
|
|
3
5
|
def self.parse(data)
|
4
6
|
|
5
|
-
if !data.keys.empty? && data.keys.first != "Configuration"
|
6
|
-
data = data.values[0]
|
7
|
-
end
|
8
|
-
|
9
7
|
configuration = Configuration.new
|
10
|
-
|
11
|
-
if
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
|
9
|
+
if !data.__xmlele.empty?
|
10
|
+
|
11
|
+
if data.__xmlele[0].first.name != "Configuration"
|
12
|
+
data = data.__xmlele[0][1]
|
13
|
+
end
|
14
|
+
|
15
|
+
data_config = data["Configuration"]
|
16
|
+
if data_config
|
17
|
+
configuration.id = data_config["id"]
|
18
|
+
configuration.name = data_config["name"]
|
19
|
+
configuration.deployed = data_config["isDeployed"] == "true" ? true : false
|
20
|
+
end
|
15
21
|
end
|
16
22
|
|
17
23
|
configuration
|