Class: Fission::UI

Inherits:
Object show all
Defined in:
lib/fission.old/ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout = $stdout) ⇒ UI


5
6
7
# File 'lib/fission.old/ui.rb', line 5

def initialize(stdout=$stdout)
  @stdout = stdout
end

Instance Attribute Details

#stdoutObject (readonly)

Returns the value of attribute stdout


3
4
5
# File 'lib/fission.old/ui.rb', line 3

def stdout
  @stdout
end

Instance Method Details

#output(s) ⇒ Object


9
10
11
# File 'lib/fission.old/ui.rb', line 9

def output(s)
  @stdout.puts s
end

#output_and_exit(s, exit_code) ⇒ Object


17
18
19
20
# File 'lib/fission.old/ui.rb', line 17

def output_and_exit(s, exit_code)
  output s
  exit exit_code
end

#output_printf(string, key, value) ⇒ Object


13
14
15
# File 'lib/fission.old/ui.rb', line 13

def output_printf(string, key, value)
  @stdout.send :printf, string, key, value
end