Class: Shiftzilla::Milestone

Inherits:
Object
  • Object
show all
Defined in:
lib/shiftzilla/milestone.rb

Instance Method Summary collapse

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

#dateObject



17
18
19
# File 'lib/shiftzilla/milestone.rb', line 17

def date
  @date
end

#stampObject



21
22
23
# File 'lib/shiftzilla/milestone.rb', line 21

def stamp
  @stamp
end