bedi 0.1.2 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b8a7912a616b17b691eb016f2752b5ce8e88b55
4
- data.tar.gz: '09e565b6f08055644355280952971c8eee1e7162'
3
+ metadata.gz: c30fef7d1e7a61b8fcfdd43bb65802d9cfa65aa4
4
+ data.tar.gz: e71f4ed62d072d589e5274026defc60b8cf13acb
5
5
  SHA512:
6
- metadata.gz: f305d45c4a8a3608441cf5b1534843f6ec0265972c55c47a5253ad5ddda9b038f780683875ddf123e985c005b5a7a9e9433d51c61851043a470f5b44123a32d4
7
- data.tar.gz: c9133c4fccb258cb895093a5708741205bc46635687c5e4cbb061c5d373742ec78b0b0924d1a5728eb2422f0921b2ef61017f3c9b88d291760ab19ee462c5f0e
6
+ metadata.gz: 4f5cea608aeca587150d0ee4691ba6c33e63eed876717aeffd9d4c775246a035526b568f3344f6e99ab6c31bd2ec40d3b650188ddb52d93b49cad32afc23e418
7
+ data.tar.gz: 67683beef5f08d9e7f31b47b4244ffa4f1f39e37a0c14c9fe0a584385207fee405642e0ed7b0a76a80ff6f6ed63de84344a4e795351f322f389c4cc34eba9051
@@ -7,10 +7,19 @@ module Bedi
7
7
  def parse(source)
8
8
  result = Parser.parse(source)
9
9
 
10
+ formatted_batches = result[:Batch].map { |b| format_batch(b) }
10
11
  {
11
- header: format(result[:Header]),
12
- entry: format(result[:Entry]),
13
- trailer: format(result[:Trailer])
12
+ batches: formatted_batches
13
+ }
14
+ end
15
+
16
+ private
17
+
18
+ def format_batch(batch)
19
+ {
20
+ header: format(batch[:Header]),
21
+ entry: format(batch[:Entry]),
22
+ trailer: format(batch[:Trailer])
14
23
  }
15
24
  end
16
25
  end
@@ -8,8 +8,14 @@ grammar Bedi::Cielo::Parser
8
8
  include Bedi::Cielo::Trailer
9
9
 
10
10
  rule Parser
11
- Header
12
- Entry*
13
- Trailer
11
+ Batch+
12
+ end
13
+
14
+ rule Batch
15
+ (
16
+ Header
17
+ Entry+
18
+ Trailer
19
+ )
14
20
  end
15
21
  end
@@ -1,3 +1,3 @@
1
1
  module Bedi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bedi
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
  - Diogo Lisboa