Module: Tracking::Base

Extended by:
Forwardable
Includes:
TrelloConfiguration
Included in:
CardDoneTracking, EffortTracking, EstimateTracking, InvalidTracking
Defined in:
lib/trello_effort_tracker/tracking/base.rb

Constant Summary collapse

TIME_CONVERTERS =
{
  'h' => lambda { |estimate| estimate },
  'd' => lambda { |estimate| estimate * 8 },
  'g' => lambda { |estimate| estimate * 8 },
  'p' => lambda { |estimate| estimate / 2  }
}
DURATION_REGEXP =
'(\d+\.?\d*[phdg])'
DATE_REGEXP =
/(\d{2})\.(\d{2})\.(\d{4})/

Instance Method Summary collapse

Methods included from TrelloConfiguration

#authorization_params_from_config_file, #tracker_username

Instance Method Details

#dateObject



23
24
25
# File 'lib/trello_effort_tracker/tracking/base.rb', line 23

def date
  Chronic.parse(date_as_string).to_date
end

#initialize(tracking_notification) ⇒ Object



19
20
21
# File 'lib/trello_effort_tracker/tracking/base.rb', line 19

def initialize(tracking_notification)
  @tracking_notification = tracking_notification
end

#to_sObject



27
28
29
# File 'lib/trello_effort_tracker/tracking/base.rb', line 27

def to_s
  "[#{date}] From #{notifier.username.color(:green)}\t on card '#{trello_card.name.color(:yellow)}': #{raw_text}"
end