lab5 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lab5.rb +3 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2695165a7fce53e50644a344ec3a5a2acc1a2b13
4
- data.tar.gz: abb45727b9207b1c4729c7ea490f0088b6951977
3
+ metadata.gz: a41c8033e20434be6e637e2ca66909456c5aeee3
4
+ data.tar.gz: d897f0bc09099d69b72eb09c7f6472f0eaec5816
5
5
  SHA512:
6
- metadata.gz: 13f2739340977c72b446dafa66daf2310cbeced9c8dcd8f0b86cec1b436f263ce6a2e0a35d38639b303cc5326860824fac33f97c08d5e73c815096c990dfe7c7
7
- data.tar.gz: 0c4891d3826036455ff03761dd88c08224fe13adb4d84efa8b16307129620cb4fb22f3dc4049692235d3d77c9c750e2abeef26f3012a045a529eea8518ad3b1d
6
+ metadata.gz: 4ae2513121ebb8ae6cd493c77345cb66442a35a85477ab555b133372eb6304faaa78e394244803981a5ac6b2fc36e101a10327124b9503562165fa6ed2d977c6
7
+ data.tar.gz: 30a465cb8d645d3ab0eb93cd849b475f7b75cacd1e218f3b5148edc59ac44510723b2a020e1565f3898563daa22bdd4f42427d85020637f42dede7ada75a0749
@@ -18,8 +18,8 @@ class XmlSerializer
18
18
  builder.to_xml
19
19
  end
20
20
 
21
- def self.deserialize_array(file)
22
- Nokogiri::XML(File.open(file)).css('object').map do |element|
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.0
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-24 00:00:00.000000000 Z
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