Class: Commands::Clients
- Inherits:
-
Object
- Object
- Commands::Clients
- Defined in:
- lib/detom/commands/clients.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(store = YamlFileStore.new) ⇒ Clients
constructor
A new instance of Clients.
Constructor Details
#initialize(store = YamlFileStore.new) ⇒ Clients
Returns a new instance of Clients.
3 4 5 |
# File 'lib/detom/commands/clients.rb', line 3 def initialize(store=YamlFileStore.new) @store = store end |
Instance Method Details
#call ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/detom/commands/clients.rb', line 7 def call @store.each do |client, tracked_time| if tracked_time.nil? puts client next end total_time = tracked_time.map {|key, value| value.reduce(&:+) }.reduce &:+ puts "#{client} #{total_time}m" end end |