recordx-parser 0.1.2 → 0.1.3

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/recordx-parser.rb +13 -4
  2. metadata +1 -1
@@ -10,6 +10,12 @@ class RecordxParser
10
10
  parse(s){|x| yield(x)}
11
11
  end
12
12
 
13
+ def to_a()
14
+ @a
15
+ end
16
+
17
+ protected
18
+
13
19
  def parse(s)
14
20
 
15
21
  s.instance_eval{
@@ -28,13 +34,16 @@ class RecordxParser
28
34
 
29
35
  if raw_records then
30
36
  node_name = raw_records[/<(\w+)/,1]
31
- records = raw_records.strip.split(/(?=<#{node_name}[^>]*>)/).map {|x| yield(x)}
37
+ a_records = raw_records.strip.split(/(?=<#{node_name}[^>]*>)/)
38
+ records = fetch_records(a_records)
32
39
  end
33
40
 
34
41
  [root_name, "", {}, [*summary], ['records', "",{}, *records]]
35
42
  end
36
-
37
- def to_a()
38
- @a
43
+
44
+ private
45
+
46
+ def fetch_records(a_records)
47
+ a_records.map {|x| yield(x)}
39
48
  end
40
49
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recordx-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors: []
7
7