dynarex 0.9.2 → 0.9.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.
- data/lib/dynarex.rb +7 -1
- metadata +1 -1
data/lib/dynarex.rb
CHANGED
@@ -11,7 +11,7 @@ require 'ostruct'
|
|
11
11
|
class Dynarex
|
12
12
|
include REXML
|
13
13
|
|
14
|
-
attr_accessor :format_mask
|
14
|
+
attr_accessor :format_mask, :delimiter
|
15
15
|
|
16
16
|
#Create a new dynarex document from 1 of the following options:
|
17
17
|
#* a local file path
|
@@ -22,8 +22,14 @@ class Dynarex
|
|
22
22
|
# Dynarex.new '<contacts><summary><schema>contacts/contact(name,age,dob)</schema></summary><records/></contacts>'
|
23
23
|
|
24
24
|
def initialize(location)
|
25
|
+
@delimiter = ' '
|
25
26
|
open(location)
|
26
27
|
end
|
28
|
+
|
29
|
+
def delimiter=(separator)
|
30
|
+
@format_mask = @format_mask.to_s.gsub(/\s/, separator)
|
31
|
+
@summary[:format_mask] = @format_mask
|
32
|
+
end
|
27
33
|
|
28
34
|
def fields
|
29
35
|
@fields
|