polyrex-createobject 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/polyrex-createobject.rb +8 -4
  2. metadata +2 -2
@@ -62,13 +62,17 @@ end
62
62
  end
63
63
 
64
64
  def create_node(parent_node, child_schema, params={}, id=nil)
65
+
65
66
  record = Rexle.new PolyrexSchema.new(child_schema).to_s
66
- @id = id if id
67
67
 
68
- if @id.to_i.to_s == @id.to_s then
69
- @id = @id.to_s.succ
68
+ if id then
69
+ @id = id
70
70
  else
71
- @id = @parent_node.element('count(//@id)').to_i + 2
71
+ if @id.to_i.to_s == @id.to_s then
72
+ @id = @id.to_s.succ
73
+ else
74
+ @id = @parent_node.element('count(//@id)').to_i + 2
75
+ end
72
76
  end
73
77
 
74
78
  record.root.add_attribute({'id' => @id.to_s.clone})
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.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors: []
7
7
 
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2011-01-21 00:00:00 +00:00
12
+ date: 2011-01-24 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency