Class: Statlysis::Top
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logs ⇒ Object
Returns the value of attribute logs.
-
#pattern_proc ⇒ Object
Returns the value of attribute pattern_proc.
-
#result_limit ⇒ Object
Returns the value of attribute result_limit.
-
#stat_model ⇒ Object
Returns the value of attribute stat_model.
-
#user_id_proc ⇒ Object
Returns the value of attribute user_id_proc.
-
#user_info_proc ⇒ Object
Returns the value of attribute user_info_proc.
Attributes inherited from Cron
#clock, #multiple_dataset, #source_type, #time_column, #time_unit, #time_zone
Instance Method Summary collapse
- #default_assign_attr(key_symbol, opts) ⇒ Object
-
#initialize(source, opts = {}) ⇒ Top
constructor
A new instance of Top.
- #run ⇒ Object
- #write ⇒ Object
Methods inherited from Cron
#_source, #group_by_columns?, #is_activerecord?, #is_mongoid?, #is_orm?, #is_time_column_integer?, #output, #reoutput, #setup_stat_model, #source_where_array, #time_column?, #time_range
Methods included from Common
Constructor Details
#initialize(source, opts = {}) ⇒ Top
Returns a new instance of Top.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/statlysis/cron/top.rb', line 10 def initialize source, opts = {} cron.result_limit = opts[:result_limit] || 100 if not opts[:test] [:pattern_proc, :user_id_proc, :user_info_proc].each do |o| raise "Please assign :#{o} params!" if opts[o].nil? && !cron.send(o) cron.send "#{o}=", opts[o] end default_assign_attr :stat_table_name, opts end super cron end |
Instance Attribute Details
#logs ⇒ Object
Returns the value of attribute logs.
6 7 8 |
# File 'lib/statlysis/cron/top.rb', line 6 def logs @logs end |
#pattern_proc ⇒ Object
Returns the value of attribute pattern_proc.
8 9 10 |
# File 'lib/statlysis/cron/top.rb', line 8 def pattern_proc @pattern_proc end |
#result_limit ⇒ Object
Returns the value of attribute result_limit.
6 7 8 |
# File 'lib/statlysis/cron/top.rb', line 6 def result_limit @result_limit end |
#stat_model ⇒ Object
Returns the value of attribute stat_model.
7 8 9 |
# File 'lib/statlysis/cron/top.rb', line 7 def stat_model @stat_model end |
#user_id_proc ⇒ Object
Returns the value of attribute user_id_proc.
8 9 10 |
# File 'lib/statlysis/cron/top.rb', line 8 def user_id_proc @user_id_proc end |
#user_info_proc ⇒ Object
Returns the value of attribute user_info_proc.
8 9 10 |
# File 'lib/statlysis/cron/top.rb', line 8 def user_info_proc @user_info_proc end |
Instance Method Details
#default_assign_attr(key_symbol, opts) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/statlysis/cron/top.rb', line 29 def default_assign_attr key_symbol, opts if opts[key_symbol] cron.send("#{key_symbol}=", opts[key_symbol]) else raise "Please assign opts[:#{key_symbol}]" end end |
#run ⇒ Object
23 24 25 |
# File 'lib/statlysis/cron/top.rb', line 23 def run cron.write end |
#write ⇒ Object
27 |
# File 'lib/statlysis/cron/top.rb', line 27 def write; raise DefaultNotImplementWrongMessage end |