Class: ChurnVsComplexity::GitDate::AbsoluteGitPeriod
- Inherits:
-
Object
- Object
- ChurnVsComplexity::GitDate::AbsoluteGitPeriod
- Defined in:
- lib/churn_vs_complexity/git_date.rb
Instance Attribute Summary collapse
-
#end_date ⇒ Object
readonly
Returns the value of attribute end_date.
Class Method Summary collapse
- .between(cli_arg_since, latest_commit_date) ⇒ Object
- .looking_back(relative_period:, from:) ⇒ Object
Instance Method Summary collapse
- #effective_start_date ⇒ Object
-
#initialize(start_date, end_date) ⇒ AbsoluteGitPeriod
constructor
A new instance of AbsoluteGitPeriod.
- #requested_start_date ⇒ Object
Constructor Details
#initialize(start_date, end_date) ⇒ AbsoluteGitPeriod
Returns a new instance of AbsoluteGitPeriod.
56 57 58 59 |
# File 'lib/churn_vs_complexity/git_date.rb', line 56 def initialize(start_date, end_date) @start_date = start_date @end_date = end_date end |
Instance Attribute Details
#end_date ⇒ Object (readonly)
Returns the value of attribute end_date.
38 39 40 |
# File 'lib/churn_vs_complexity/git_date.rb', line 38 def end_date @end_date end |
Class Method Details
.between(cli_arg_since, latest_commit_date) ⇒ Object
40 41 42 43 |
# File 'lib/churn_vs_complexity/git_date.rb', line 40 def self.between(cli_arg_since, latest_commit_date) start_date = Date.strptime(cli_arg_since, '%Y-%m-%d') new(start_date, latest_commit_date) end |
.looking_back(relative_period:, from:) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/churn_vs_complexity/git_date.rb', line 45 def self.looking_back(relative_period:, from:) shifter = case relative_period when :month then 1 when :quarter then 3 when :year then 12 else raise Error, "Unexpected since value #{relative_period}" end start_date = from << shifter new(start_date, from) end |
Instance Method Details
#effective_start_date ⇒ Object
61 |
# File 'lib/churn_vs_complexity/git_date.rb', line 61 def effective_start_date = @start_date |
#requested_start_date ⇒ Object
63 |
# File 'lib/churn_vs_complexity/git_date.rb', line 63 def requested_start_date = @start_date |