Module: Doodle::ReportsHelper
- Defined in:
- app/helpers/doodle/reports_helper.rb
Class Method Summary collapse
- .online_users_and_protocols_in_progress ⇒ Object
- .protocol_with_status(status) ⇒ Object
- .service_metrics ⇒ Object
- .waiting_users ⇒ Object
Class Method Details
.online_users_and_protocols_in_progress ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/helpers/doodle/reports_helper.rb', line 5 def online_users_and_protocols_in_progress result = [] protocols_in_progress = Doodle::Protocol.number_by_user(Doodle::UserChannel.user_by_status(UserChannel::STATUSES[:online])) protocols_in_progress.each do |k, v| result << {login: User.find(k).login, number: v} end result end |
.protocol_with_status(status) ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/helpers/doodle/reports_helper.rb', line 22 def protocol_with_status(status) result = [] Doodle::Channel.all.pluck(:name).each do |n| result << {name: n, number: Protocol.in_channel_with_status(n, status).count} end result end |
.service_metrics ⇒ Object
30 31 32 33 34 35 |
# File 'app/helpers/doodle/reports_helper.rb', line 30 def service_metrics { waiting_time: "#{Doodle::Protocol.average_waiting_time.round / 60.to_f} min", service_time: "#{Doodle::Protocol.average_service_time.round / 60.to_f} min" } end |
.waiting_users ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/helpers/doodle/reports_helper.rb', line 14 def waiting_users result = [] Doodle::User::Analyst.inative.pluck(:login).each do |v| result << {login: v} end result end |