Class: GitStats::GitData::Activity
- Inherits:
-
Object
- Object
- GitStats::GitData::Activity
- Defined in:
- lib/git_stats/git_data/activity.rb
Instance Method Summary collapse
- #by_date ⇒ Object
- #by_hour ⇒ Object
- #by_hour_array ⇒ Object
- #by_month ⇒ Object
- #by_month_array ⇒ Object
- #by_wday ⇒ Object
- #by_wday_array ⇒ Object
- #by_wday_hour ⇒ Object
- #by_year ⇒ Object
- #by_year_month ⇒ Object
-
#initialize(commits) ⇒ Activity
constructor
A new instance of Activity.
Constructor Details
#initialize(commits) ⇒ Activity
Returns a new instance of Activity.
6 7 8 |
# File 'lib/git_stats/git_data/activity.rb', line 6 def initialize(commits) add_commits(commits) end |
Instance Method Details
#by_date ⇒ Object
10 11 12 |
# File 'lib/git_stats/git_data/activity.rb', line 10 def by_date @by_date ||= default_hash end |
#by_hour ⇒ Object
14 15 16 |
# File 'lib/git_stats/git_data/activity.rb', line 14 def by_hour @by_hour ||= default_hash end |
#by_hour_array ⇒ Object
18 19 20 |
# File 'lib/git_stats/git_data/activity.rb', line 18 def by_hour_array by_hour.to_key_indexed_array(min_size: 24, default: 0) end |
#by_month ⇒ Object
34 35 36 |
# File 'lib/git_stats/git_data/activity.rb', line 34 def by_month @by_month ||= default_hash end |
#by_month_array ⇒ Object
38 39 40 |
# File 'lib/git_stats/git_data/activity.rb', line 38 def by_month_array by_month.to_key_indexed_array(min_size: 13, default: 0)[1..-1] end |
#by_wday ⇒ Object
22 23 24 |
# File 'lib/git_stats/git_data/activity.rb', line 22 def by_wday @by_wday ||= default_hash end |
#by_wday_array ⇒ Object
26 27 28 |
# File 'lib/git_stats/git_data/activity.rb', line 26 def by_wday_array by_wday.to_key_indexed_array(min_size: 7, default: 0) end |
#by_wday_hour ⇒ Object
30 31 32 |
# File 'lib/git_stats/git_data/activity.rb', line 30 def by_wday_hour @by_wday_hour ||= default_double_hash end |
#by_year ⇒ Object
42 43 44 |
# File 'lib/git_stats/git_data/activity.rb', line 42 def by_year @by_year ||= default_hash end |
#by_year_month ⇒ Object
46 47 48 |
# File 'lib/git_stats/git_data/activity.rb', line 46 def by_year_month @by_year_month ||= default_double_hash end |