Class: Jah::Who
Constant Summary
Constants included from Command
Class Method Summary collapse
Methods included from Command
Class Method Details
.all ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/jah/commands/who.rb', line 13 def self.all @who = `who`.to_a.map do |l| l = l.split(" ") hash = {} hash[:who] = l[0] hash[:tty] = l[1] 2.times{ l.delete(l[0]) } hash[:date] = l.join(" ") hash end end |
.snap ⇒ Object
7 8 9 10 11 |
# File 'lib/jah/commands/who.rb', line 7 def self.snap all.map do |w| "#{w[:who]} Logado via #{w[:terminal]} desde a data: #{w[:date]}" end.join("\n") end |