rixml 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c712e2ad6891b208926563f1eb08d300b75e1b2c
4
- data.tar.gz: 8956d458ce9b8aadb086e8382429870594f92c0e
3
+ metadata.gz: 39a54d4cfd789af298b2e87028cba0a17b6ab66c
4
+ data.tar.gz: 62154eff3bc6e210eb17c9ea04494a0394485a77
5
5
  SHA512:
6
- metadata.gz: 378f5dc566186f98d958211d2ad976d9c3a0caa7dc431d2c3b742b2685653ecf4e97d057165c33429c672c1467637e712cec7ed74d31a81ef042f2cbd936e2df
7
- data.tar.gz: 3860a2b24951a048432d5bd4435358552082cd60abf026f49c7ea524dfe6933b2823ea0e88ad7780663643a98a6958b39f11f83a310d1538e62d3562347c31ac
6
+ metadata.gz: 5ade63c9f849c21d50c5995bb86bbeea76052382367cc5caf8a48afab08d34755d19af5e863383da795b12885faaaeb61aec19acab36f7fce1c698c9a3f41654
7
+ data.tar.gz: fb27afdc9bf08a0779d08086c83d7458cc52ec1fd5255d68c9bdc9ba6803f8dcfdf58e2e50ed8024812c94bd4b231d3e020da6a0fd3f90976a13951194a14822
@@ -5,7 +5,8 @@ module RixmlDocument
5
5
  hash = {}
6
6
  attributes = self.class.instance_variable_get(:@attributes)
7
7
  elements = self.class.instance_variable_get(:@elements)
8
- (attributes.to_a + elements.to_a).each do |k, _|
8
+ content = retrieve_content_tag
9
+ (attributes.to_a + elements.to_a + content.to_a).each do |k, _|
9
10
  value = send(k)
10
11
  hash[k] = serialize_attribute(value)
11
12
  end
@@ -14,6 +15,12 @@ module RixmlDocument
14
15
 
15
16
  private
16
17
 
18
+ def retrieve_content_tag
19
+ content = self.class.instance_variable_get(:@content)
20
+ return {} if content.nil?
21
+ { content.name.to_sym => content }
22
+ end
23
+
17
24
  def serialize_attribute(attribute)
18
25
  if attribute.is_a?(Array)
19
26
  attribute.map { |a| serialize_attribute(a) }
@@ -8,6 +8,7 @@ module RixmlDocument
8
8
  include HappyMapper
9
9
  tag 'OrganizationId'
10
10
 
11
- attribute :id_type, RixmlType::NormalizedString, tag: 'idType'
11
+ attribute :id_type, String, tag: 'idType'
12
+ content :id_value, String
12
13
  end
13
14
  end
data/rixml.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'rixml'
4
- s.version = '0.5.2'
5
- s.date = '2017-10-17'
4
+ s.version = '0.5.3'
5
+ s.date = '2017-10-18'
6
6
  s.summary = 'RIXML Parser'
7
7
  s.description = 'Parse RIXML files'
8
8
  s.homepage = 'https://github.com/AlphaExchange/rixml'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rixml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Correia Santos
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-10-17 00:00:00.000000000 Z
12
+ date: 2017-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler