polyrex 0.9.7 → 0.9.8

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: 9e35802a9693f4b39bf1059cf88b5d2a255adb93
4
- data.tar.gz: 65da0762a7bfae0ef61513e65a38ff2cb1e719c0
3
+ metadata.gz: 4979f33552bf45fb8dc60ed04bffe094c9f02a56
4
+ data.tar.gz: cccc6176ea90f6923151ede50cfc951323128e4c
5
5
  SHA512:
6
- metadata.gz: 10e6f734c8018595e2d84c25406ae97862ff7b32f96628f493ab5688215d346501955f8130505cccc4ed271121e2d6ca6148c510973f65ab01ca0077561ec116
7
- data.tar.gz: 07e294081c17e55bac3e6a7e2e6f5fefc762171f21f13eb8740b9f85d4925538eba74a4348f2eada1b28fdb92235176ac940e96296d86af1f1052eec1f838fb1
6
+ metadata.gz: f587f81bc5490a91335937c48a25112f6894a5e84b1ad4f30603f8b056b7c11e1285abf737e0342d6e837dbaa36ac5cf02bc6d1e4776266e9b78ae984fc64d99
7
+ data.tar.gz: ae1e8eaa32d4e6f7bf62cdfbe910a66c8c3e79cff90747381104313d03f696746b91b5786e10c5dafdf86a1e53d0d2e7eb9d96c6ca8d8228c075ec8ea0ee5149
checksums.yaml.gz.sig CHANGED
@@ -1 +1,2 @@
1
- Y[#���Z�9ȪA��,�=uL�)�@�\��!۶~��H'��Q���*��Z�mڥU5'?����B�o֠Z��5@x��˜6���K���D�b�%�8!Ȼ�0d��<��� ���̂z*�J 9�1�xǦ��E�k����_+ZI��ٛ��h���C�Y��*f�*M%nS<H|�z��$xK�*ݫ�F'����I�.�qA��N���€�vS��q�k�ߥ��ok��*��Z�@-x�I�v��"�?
1
+ SD#G٧�C0�׉W� �-�ȳ�kO;�o 7Bj�����y�E傒�g��C��\�6�*�|��9�I��Wr�����<�k��3B�3,��>��FPH�5��W�Ĕ�/(��PV����`�5������/������
2
+ �E��Y"˧������h(��΢��
data.tar.gz.sig CHANGED
Binary file
data/lib/polyrex.rb CHANGED
@@ -43,6 +43,7 @@ class Polyrex
43
43
  def initialize(location=nil, opt={})
44
44
 
45
45
  options = {id_counter: '1'}.merge opt
46
+
46
47
  @id_counter = options[:id_counter]
47
48
  @format_masks = []
48
49
  @delimiter = ''
@@ -80,7 +81,7 @@ class Polyrex
80
81
  CGI.unescapeHTML(to_xml(options))
81
82
  end
82
83
 
83
- def create(id=nil)
84
+ def create(id: nil)
84
85
  # @create is a PolyrexCreateObject, @parent_node is a Rexle::Element pointing to the current record
85
86
 
86
87
  @create.id = id || @id_counter
@@ -128,7 +129,7 @@ class Polyrex
128
129
 
129
130
  def find_by_id(id)
130
131
  @parent_node = @doc.root.element("//[@id='#{id}']")
131
- @objects[@parent_node.name].new(@parent_node, @id)
132
+ @objects[@parent_node.name].new(@parent_node, id: @id)
132
133
  end
133
134
 
134
135
  def id(id)
@@ -409,8 +410,8 @@ EOF
409
410
 
410
411
  def load_handlers(schema)
411
412
 
412
- @create = PolyrexCreateObject.new(schema, @id_counter)
413
- objects = PolyrexObjects.new(schema, @id_counter)
413
+ @create = PolyrexCreateObject.new(schema, id: @id_counter)
414
+ objects = PolyrexObjects.new(schema)
414
415
 
415
416
  @objects = objects.to_h.inject({}){|r,x| r.merge x[0].downcase => x[-1]}
416
417
  @objects_a = objects.to_a
@@ -536,7 +537,7 @@ EOF
536
537
  self.instance_eval(
537
538
  %Q(
538
539
  def #{name.downcase}()
539
- @objects['#{name}'].new(@parent_node.element('.'), @id)
540
+ @objects['#{name}'].new(@parent_node.element('.'), id: @id)
540
541
  end
541
542
  ))
542
543
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  wbQnaFmJMPFyXo9Yh/95QJEinnBsM0Yk8nJhmcChjdCpQL5243BjgzVEjHI1Ouxe
32
32
  SmUIljyExpxiHQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-07-20 00:00:00.000000000 Z
34
+ date: 2014-07-27 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: polyrex-schema
metadata.gz.sig CHANGED
Binary file