sof-cycle 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: a371875b67c2b91bcda00cd042bfa8f4daed5c0ecdbdff66b5680f546b039435
4
- data.tar.gz: 720805643f533158704ad8316a95f0cf1d31b02681a4a7654a4e859951216242
3
+ metadata.gz: ea1c2c9a48bba72114b7681278cd467c57ee147f6f8b1ff176b4508de355920b
4
+ data.tar.gz: 93a7560799df4730a5eaf2d14708b9a24199c0a95d2b01f1487ddc587b0846da
5
5
  SHA512:
6
- metadata.gz: 48aa749e3b0c8a8c810d8e863025af1dadc964348f4f98670f03fade2da9aded8be063c2fe7893ee50b3f9836de3658dc93137a8c41fa9e7afd33e8a51e8c3b3
7
- data.tar.gz: 18148c4e037cd7edd5749ac2c216d13e63ac581065a2a6d45101947dfa5b9d041e611bbc64d36d20336c846cc0272c7eb3eeb077831372661de1512d2f0e3f2c
6
+ metadata.gz: baf569f5fb7e0500b8a28915c8f19b86dc97ebee380301787182216d162fd02e659645345d369440959ebde737b59bb8ddd4372dae0bf014a9e3b448e8455e03
7
+ data.tar.gz: 84756e0428c56a7f6dd72e5dc7aa545a587bbffd49479a436e4f8bee2d60ec3496e128f713a36b0169799ff908e0690e4518b147e750eaa0fb662681f0e036a0
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.2] - 2024-08-09
9
+
10
+ ### Added
11
+
12
+ - `Cycle#recurring?` to reveal if a given Cycle is one-and-done or must be repeated.
13
+
8
14
  ## [0.1.1] - 2024-08-09
9
15
 
10
16
  ### Added
@@ -14,9 +20,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
20
  subsequent period
15
21
  - Add predicate methods for each `Cycle` subclass. E.g. `#dormant?`, `#within?`, etc
16
22
  - Refactor into namespaces
17
-
18
- ## [0.1.0] - 2024-07-09
19
-
20
- ### Added
21
-
22
- - Initial extraction
@@ -0,0 +1 @@
1
+ 78a488a4cea134800aeca3e3e06461a413c564b111d96b25a74c4ae44b5afa66a04d4c59be33cc455bab0c9b1d80cfdd3af1b980859ae3955cb1fd7350fe1459
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SOF
4
4
  class Cycle
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
data/lib/sof/cycle.rb CHANGED
@@ -25,7 +25,7 @@ module SOF
25
25
 
26
26
  delegate [:activated_notation, :volume, :from, :from_date, :time_span, :period,
27
27
  :humanized_period, :period_key, :active?] => :@parser
28
- delegate [:kind, :volume_only?, :valid_periods] => "self.class"
28
+ delegate [:kind, :recurring?, :volume_only?, :valid_periods] => "self.class"
29
29
  delegate [:period_count, :duration] => :time_span
30
30
  delegate [:calendar?, :dormant?, :end_of?, :lookback?, :volume_only?,
31
31
  :within?] => :kind_inquiry
@@ -130,10 +130,11 @@ module SOF
130
130
  @kind = nil
131
131
  @valid_periods = []
132
132
 
133
- def self.volume_only? = @volume_only
134
-
135
133
  class << self
136
134
  attr_reader :notation_id, :kind, :valid_periods
135
+ def volume_only? = @volume_only
136
+
137
+ def recurring? = raise "#{name} must implement #{__method__}"
137
138
  end
138
139
 
139
140
  # Raises an error if the given period isn't in the list of valid periods.
@@ -12,6 +12,8 @@ module SOF
12
12
  def frame_of_reference = "total"
13
13
  end
14
14
 
15
+ def self.recurring? = true
16
+
15
17
  def to_s
16
18
  "#{volume}x every #{period_count} calendar #{humanized_period}"
17
19
  end
@@ -10,6 +10,8 @@ module SOF
10
10
 
11
11
  attr_reader :cycle, :parser
12
12
 
13
+ def self.recurring? = false
14
+
13
15
  def kind = :dormant
14
16
 
15
17
  def dormant? = true
@@ -8,6 +8,8 @@ module SOF
8
8
  @kind = :end_of
9
9
  @valid_periods = %w[W M Q Y]
10
10
 
11
+ def self.recurring? = true
12
+
11
13
  def to_s
12
14
  return dormant_to_s if dormant?
13
15
 
@@ -8,6 +8,8 @@ module SOF
8
8
  @kind = :lookback
9
9
  @valid_periods = %w[D W M Y]
10
10
 
11
+ def self.recurring? = true
12
+
11
13
  def to_s = "#{volume}x in the prior #{period_count} #{humanized_period}"
12
14
 
13
15
  def volume_to_delay_expiration(completion_dates, anchor:)
@@ -19,6 +19,8 @@ module SOF
19
19
  end
20
20
  end
21
21
 
22
+ def self.recurring? = false
23
+
22
24
  def to_s = "#{volume}x total"
23
25
 
24
26
  def covered_dates(dates, ...) = dates
@@ -8,6 +8,8 @@ module SOF
8
8
  @kind = :within
9
9
  @valid_periods = %w[D W M Y]
10
10
 
11
+ def self.recurring? = false
12
+
11
13
  def to_s = "#{volume}x within #{date_range}"
12
14
 
13
15
  def date_range
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sof-cycle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay
@@ -52,6 +52,7 @@ files:
52
52
  - Rakefile
53
53
  - checksums/sof-cycle-0.1.0.gem.sha512
54
54
  - checksums/sof-cycle-0.1.1.gem.sha512
55
+ - checksums/sof-cycle-0.1.2.gem.sha512
55
56
  - lib/sof-cycle.rb
56
57
  - lib/sof/cycle.rb
57
58
  - lib/sof/cycle/version.rb