x12-lite 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/x12-lite.rb +22 -22
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8d4f7517a48b4d459c504acd82cd03026d9ce92d9ac050358806d99079f63ec
4
- data.tar.gz: c94c80e10ffae8aaa0919d6a48301229ff64fc0e6fabda94d70c153700c5ca1c
3
+ metadata.gz: c0dda270782d3da6aa8372f5e723020f80307bb7b79863adad4395f37181d6ea
4
+ data.tar.gz: 07f4bd9ff342f3e1a10744eed0ddc1e457002f2d7b997acbe6e13aaa852cb153
5
5
  SHA512:
6
- metadata.gz: a6a165012d316612f5271b3a4c9be843b96ff3726c85b54500b0ebd178c14a55af88d4a0497c811e5680f7133c0bd6ebac40e3f2a9d22871bfc51787c8bfe37c
7
- data.tar.gz: d3151ad5b56cb3fa01434b0771cda436c2c131e1ee5ef6edf507f0447a6d95de28694d688ad5efc1047bfe2864ab257a1f0ff5ad4d19a36ff21b5c47a607a921
6
+ metadata.gz: 4bb1cfab0e81e8ac3ac4ef44908502480287f4d93fab64d3447d01770fdade114d706c99df7a8085f35f46dac9bf1cd2c7e44bb5236c594d867f69b922221903
7
+ data.tar.gz: ac5eca285b4671120d79dbeed83502ef8959501344d8a1575ea97954194256c72593b99e1ad21e17dc6df104808bfe60fd3305009530cb579800d927240562c3
data/lib/x12-lite.rb CHANGED
@@ -45,7 +45,7 @@ end
45
45
  # ==[ X12 ]=====================================================================
46
46
 
47
47
  class X12
48
- VERSION="0.3.2"
48
+ VERSION="0.3.3"
49
49
 
50
50
  include Enumerable
51
51
 
@@ -368,27 +368,27 @@ class X12
368
368
  self
369
369
  end
370
370
 
371
- # def each(seg=nil)
372
- # to_a.each do |item|
373
- # next if seg && !(seg === item[0])
374
- # yield item
375
- # end
376
- # end
377
- #
378
- # # means this each may change @ary, so clear @str in case
379
- # def each!(...)
380
- # out = each(...)
381
- # @str &&= nil
382
- # out
383
- # end
384
- #
385
- # def grep(who)
386
- # inject([]) do |ary, row|
387
- # ary.push(block_given? ? yield(row) : row) if who === row.first
388
- # ary
389
- # end
390
- # end
391
- #
371
+ def each(seg=nil)
372
+ to_a.each do |row|
373
+ next if seg && !(seg === row.first)
374
+ yield row
375
+ end
376
+ end
377
+
378
+ # means this each may change @ary, so clear @str in case
379
+ def each!(...)
380
+ out = each(...)
381
+ @str &&= nil
382
+ out
383
+ end
384
+
385
+ def grep(seg)
386
+ reduce([]) do |ary, row|
387
+ ary.push(block_given? ? yield(row) : row) if seg === row.first
388
+ ary
389
+ end
390
+ end
391
+
392
392
  # def now(fmt="%Y%m%d%H%M%S")
393
393
  # Time.now.strftime(fmt)
394
394
  # end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: x12-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-10-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby gem to parse and generate X.12 transactions
14
14
  email: steve.shreeve@gmail.com