Class: Shiftzilla::Milestone
- Inherits:
-
Object
- Object
- Shiftzilla::Milestone
- Defined in:
- lib/shiftzilla/milestone.rb
Instance Method Summary collapse
- #date ⇒ Object
-
#initialize(mtxt) ⇒ Milestone
constructor
A new instance of Milestone.
- #stamp ⇒ Object
Constructor Details
#initialize(mtxt) ⇒ Milestone
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/shiftzilla/milestone.rb', line 5 def initialize(mtxt) @date = nil @stamp = '' if mtxt.start_with?('today') @date = variable_date(mtxt) @stamp = @date.strftime('%Y-%m-%d') elsif not (mtxt.nil? or mtxt == '') @date = Date.parse(mtxt) @stamp = mtxt end end |
Instance Method Details
#date ⇒ Object
17 18 19 |
# File 'lib/shiftzilla/milestone.rb', line 17 def date @date end |
#stamp ⇒ Object
21 22 23 |
# File 'lib/shiftzilla/milestone.rb', line 21 def stamp @stamp end |