dynarex 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- 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
|