polyrex-createobject 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/polyrex-createobject.rb +4 -4
  2. metadata +1 -1
@@ -10,9 +10,9 @@ class PolyrexCreateObject
10
10
 
11
11
  attr_accessor :id
12
12
 
13
- def initialize(schema, id=nil)
13
+ def initialize(schema, id='1')
14
14
  @id = id
15
- @id ||= 1
15
+
16
16
  @schema = schema
17
17
  a = @schema.split('/')
18
18
 
@@ -60,8 +60,8 @@ end
60
60
  @id = id if id
61
61
 
62
62
  record.root.add_attribute('id', @id.to_s)
63
- if @id.to_s[/[0-9]/] then
64
- @id = (@id.to_i + 1).to_s
63
+ if @id[/[0-9]/] then
64
+ @id.succ!
65
65
  else
66
66
  @id = XPath.first(@parent_node.root, 'count(//@id)').to_i + 2
67
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-createobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors: []
7
7