Class: Rtasklib::Models::TWDuration
- Inherits:
-
ISO8601::Duration
- Object
- ISO8601::Duration
- Rtasklib::Models::TWDuration
- Defined in:
- lib/rtasklib/models.rb
Overview
A subclass of the ISO8601::Duration object that use `task calc` to parse string names like 'weekly', 'biannual', and '3 quarters'
Modifies the #initialize method, preserving the original string duration
Instance Attribute Summary (collapse)
-
- (Object) frozen_value
readonly
Returns the value of attribute frozen_value.
Instance Method Summary (collapse)
-
- (TWDuration) initialize(input, base = nil)
constructor
A new instance of TWDuration.
Constructor Details
- (TWDuration) initialize(input, base = nil)
Returns a new instance of TWDuration
21 22 23 24 25 26 |
# File 'lib/rtasklib/models.rb', line 21 def initialize input, base=nil @frozen_value = input.dup.freeze parsed = `task calc #{input}`.chomp super parsed, base end |
Instance Attribute Details
- (Object) frozen_value (readonly)
Returns the value of attribute frozen_value
19 20 21 |
# File 'lib/rtasklib/models.rb', line 19 def frozen_value @frozen_value end |