lab5 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lab5.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a41c8033e20434be6e637e2ca66909456c5aeee3
|
4
|
+
data.tar.gz: d897f0bc09099d69b72eb09c7f6472f0eaec5816
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ae2513121ebb8ae6cd493c77345cb66442a35a85477ab555b133372eb6304faaa78e394244803981a5ac6b2fc36e101a10327124b9503562165fa6ed2d977c6
|
7
|
+
data.tar.gz: 30a465cb8d645d3ab0eb93cd849b475f7b75cacd1e218f3b5148edc59ac44510723b2a020e1565f3898563daa22bdd4f42427d85020637f42dede7ada75a0749
|
data/lib/lab5.rb
CHANGED
@@ -18,8 +18,8 @@ class XmlSerializer
|
|
18
18
|
builder.to_xml
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.deserialize_array(
|
22
|
-
Nokogiri::XML(
|
21
|
+
def self.deserialize_array(xml)
|
22
|
+
Nokogiri::XML(xml).css('object').map do |element|
|
23
23
|
object = element.attribute('class_name').value.constantize.new
|
24
24
|
element.css('instance_variable').each do |var_element|
|
25
25
|
object.instance_variable_set(var_element.attribute('name').value, var_element.text)
|
@@ -28,4 +28,4 @@ class XmlSerializer
|
|
28
28
|
object
|
29
29
|
end
|
30
30
|
end
|
31
|
-
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lab5
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tatiana Karpesh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: XML serializer/deserializer
|
14
14
|
email: tatiana.karpesh@gmail.com
|