eddy 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fa052397cd79892f3d217a12fcead78e2f7a61f6a9f5d891ec7816886473332
4
- data.tar.gz: 8c3bbf9f116f266d6a7003381577282a596eabce627dc29440dc3ea52b165624
3
+ metadata.gz: ff143c2c6caaef18067adde4cdd0fbea603e487726eab041b53e5c5e26c5f2a4
4
+ data.tar.gz: 04c50a0a9c596c72a626c97e048b872698050a81f7c38a1fe2b6e33856a5f24e
5
5
  SHA512:
6
- metadata.gz: 2516fc9013898bf3e3063d8a6387237a6677deda40998aec3c267cf4c08d443f9d190ca77eeb0ab2fa09225c9f6720cc4dcb0c60660d34b78450e80144aedd81
7
- data.tar.gz: 8348c053aea2768a07237ab2bdd64102a499aa4b686fb4c8bdb359890ddfe4c17f37402c753c601357670999e68c8a273ad482ce22d4e7401b12458dbc14ab49
6
+ metadata.gz: 57f2b71dfd3fb443f174aef086c219821193adffa2e2878472b3cdee0ea075b7d9781b0899921994d9d1d385be2f7f99ad75fd71b31dcd6e0f6daba8407e989a
7
+ data.tar.gz: 8ca2545fb05a98e10b30738f7d88982fa1cdc7f45f1200b804333a1acb3a40eaf2bf489de00e4bde4df127b54933e2e4618de9a4b8d3ee6e8b13717cb213a8da
data/CHANGELOG.md CHANGED
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ## master (unreleased)
15
15
 
16
+ ## 0.8.0 (2020-01-08)
17
+
18
+ ### Added
19
+
20
+ - Allow skipping of segments by setting `Eddy::Models::Segment.skip` to `true`.
21
+
16
22
  ## 0.7.0 (2020-01-08)
17
23
 
18
24
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eddy (0.7.0)
4
+ eddy (0.8.0)
5
5
  ginny (~> 0.6.3)
6
6
  json_schemer (~> 0.2.8)
7
7
  thor (~> 1.0.1)
data/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  [travis-ci]: https://travis-ci.org/tcd/eddy
11
11
  [coveralls]: https://coveralls.io/github/tcd/eddy?branch=master
12
12
  [license]: https://github.com/tcd/eddy/blob/master/LICENSE.txt
13
- [docs]: https://www.rubydoc.info/gems/eddy/0.7.0
13
+ [docs]: https://www.rubydoc.info/gems/eddy/0.8.0
14
14
 
15
15
  ## Installation
16
16
 
@@ -13,6 +13,8 @@ module Eddy
13
13
  attr_accessor :elements
14
14
  # @return [Eddy::Data::Store] Data passed down from a Transaction Set.
15
15
  attr_accessor :store
16
+ # @return [Boolean] (false) If true, `#render` will return `nil`.
17
+ attr_accessor :skip
16
18
 
17
19
  # All of a Segment's elements need to be declared in its constructor.
18
20
  #
@@ -20,14 +22,16 @@ module Eddy
20
22
  # @param elements [Eddy::Models::Element::Base]
21
23
  # @return [void]
22
24
  def initialize(store, *elements)
25
+ self.skip = false
23
26
  self.store = store
24
27
  elements.flatten!
25
28
  self.elements = elements || []
26
29
  end
27
30
 
28
31
  # @param separator [String] (self.store.element_separator) String used to delimit elements within a segment.
29
- # @return [String]
32
+ # @return [String,nil]
30
33
  def render(separator = self.store.element_separator)
34
+ return nil if self.skip
31
35
  segment = [self.id, self.elements.map(&:value)].join(separator)
32
36
  return Eddy::Util.trim_delims_from_segment(segment, separator: separator)
33
37
  end
@@ -78,7 +78,7 @@ module Eddy
78
78
  # @return [String]
79
79
  def render(s_sep = self.store.segment_separator)
80
80
  add_envelope()
81
- return self.all_components.map { |s| s.render(self.store.element_separator) }.join(s_sep)
81
+ return self.all_components.map { |s| s.render(self.store.element_separator) }.compact.join(s_sep)
82
82
  end
83
83
 
84
84
  # Return all contained Segments in a single, flattened array.
data/lib/eddy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eddy
2
- VERSION = "0.7.0".freeze
2
+ VERSION = "0.8.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clay Dunston
@@ -1569,7 +1569,7 @@ metadata:
1569
1569
  homepage_uri: https://github.com/tcd/eddy
1570
1570
  source_code_uri: https://github.com/tcd/eddy
1571
1571
  changelog_uri: https://github.com/tcd/eddy/blob/master/CHANGELOG.md
1572
- documentation_uri: https://www.rubydoc.info/gems/eddy/0.7.0
1572
+ documentation_uri: https://www.rubydoc.info/gems/eddy/0.8.0
1573
1573
  yard.run: yri
1574
1574
  post_install_message:
1575
1575
  rdoc_options: []