Class: RPS::UI

Inherits:
Object
  • Object
show all
Defined in:
lib/rps/ui.rb

Instance Method Summary collapse

Constructor Details

#initialize(io = $stdout, opts = {}) ⇒ UI

Returns a new instance of UI.



4
5
6
7
# File 'lib/rps/ui.rb', line 4

def initialize(io = $stdout, opts = {})
  @io = io
  @opts = opts
end

Instance Method Details

#render(process) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/rps/ui.rb', line 9

def render(process)
  string = []

  string << process.pid.to_s
  string << "[#{process.exe}]"
  string << process.command_line.join(' ')
  string << "cwd=#{process.cwd}" if @opts[:cwd]

  @io << string.join(' ') << "\n"
end