dynarex 0.9.11 → 0.9.12

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/dynarex.rb +7 -2
  2. metadata +1 -1
@@ -214,8 +214,13 @@ EOF
214
214
  #Delete a record.
215
215
  # dyarex.delete 3 # deletes record with id 3
216
216
 
217
- def delete(id)
218
- @doc.delete("records/*[@id='#{id}']")
217
+ def delete(x)
218
+
219
+ if x.to_i.to_s.length == x.to_s.length and x[/[0-9]/] then
220
+ @doc.delete("records/*[@id='#{x}']")
221
+ else
222
+ @doc.delete x
223
+ end
219
224
  load_records
220
225
  self
221
226
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11
4
+ version: 0.9.12
5
5
  platform: ruby
6
6
  authors: []
7
7