Class: Stats::UserStats
- Inherits:
-
Object
- Object
- Stats::UserStats
- Defined in:
- app/models/stats/user_stats.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #actions ⇒ Object
- #contexts ⇒ Object
-
#initialize(user) ⇒ UserStats
constructor
A new instance of UserStats.
- #projects ⇒ Object
- #tag_cloud ⇒ Object
- #tag_cloud_90days ⇒ Object
- #totals ⇒ Object
Constructor Details
#initialize(user) ⇒ UserStats
Returns a new instance of UserStats.
5 6 7 |
# File 'app/models/stats/user_stats.rb', line 5 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
3 4 5 |
# File 'app/models/stats/user_stats.rb', line 3 def user @user end |
Instance Method Details
#actions ⇒ Object
9 10 11 |
# File 'app/models/stats/user_stats.rb', line 9 def actions @actions ||= Stats::Actions.new(user) end |
#contexts ⇒ Object
21 22 23 |
# File 'app/models/stats/user_stats.rb', line 21 def contexts @contexts ||= Stats::Contexts.new(user) end |
#projects ⇒ Object
17 18 19 |
# File 'app/models/stats/user_stats.rb', line 17 def projects @projects ||= Stats::Projects.new(user) end |
#tag_cloud ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/models/stats/user_stats.rb', line 25 def tag_cloud unless @tag_cloud = Stats::TagCloudQuery.new(user).result @tag_cloud = Stats::TagCloud.new() end @tag_cloud end |
#tag_cloud_90days ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'app/models/stats/user_stats.rb', line 33 def tag_cloud_90days unless @tag_cloud_90days cutoff = 3.months.ago.beginning_of_day = Stats::TagCloudQuery.new(user, cutoff).result @tag_cloud_90days = Stats::TagCloud.new() end @tag_cloud_90days end |
#totals ⇒ Object
13 14 15 |
# File 'app/models/stats/user_stats.rb', line 13 def totals @totals ||= Stats::Totals.new(user) end |