Class: Stats::Contexts

Inherits:
Object
  • Object
show all
Defined in:
app/models/stats/contexts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Contexts

Returns a new instance of Contexts.



5
6
7
# File 'app/models/stats/contexts.rb', line 5

def initialize(user)
  @user = user
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



3
4
5
# File 'app/models/stats/contexts.rb', line 3

def user
  @user
end

Instance Method Details

#actionsObject



9
10
11
# File 'app/models/stats/contexts.rb', line 9

def actions
  @actions ||= Stats::TopContextsQuery.new(user, :limit => 5).result
end

#running_actionsObject



13
14
15
# File 'app/models/stats/contexts.rb', line 13

def running_actions
  @running_actions ||= Stats::TopContextsQuery.new(user, :limit => 5, :running => true).result
end