Class: Hubtime::Activity::Month

Inherits:
Period
  • Object
show all
Defined in:
lib/hubtime/activity.rb

Instance Attribute Summary

Attributes inherited from Period

#children, #compiled, #example, #label, #repo_stats, #total_stats

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Period

#_first_child_key, #_last_child_key, #add, #additions, #child_keys, #commits, #compile!, #compiled?, #count, #default_stats, #deletions, #first!, #first?, #impact, #import, #initialize, #key_value, #last!, #last?, #repositories

Constructor Details

This class inherits a constructor from Hubtime::Activity::Period

Class Method Details

.child_classObject



251
252
253
# File 'lib/hubtime/activity.rb', line 251

def self.child_class
  Day
end

.display(time) ⇒ Object



247
248
249
# File 'lib/hubtime/activity.rb', line 247

def self.display(time)
  time.strftime("%m")
end

Instance Method Details

#first_child_keyObject



255
256
257
# File 'lib/hubtime/activity.rb', line 255

def first_child_key
  "01"
end

#last_child_keyObject



259
260
261
262
263
264
265
266
267
# File 'lib/hubtime/activity.rb', line 259

def last_child_key
  if self.example
    # how many days in this month
    self.class.child_class.display(self.example.end_of_month)
  else
    # TODO: nothing this month?
    "30"
  end
end