Class: Tr3llo::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/3llo/interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, output) ⇒ Interface

Returns a new instance of Interface.



3
4
5
# File 'lib/3llo/interface.rb', line 3

def initialize(input, output)
  @input, @output = input, output
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



28
29
30
# File 'lib/3llo/interface.rb', line 28

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output.



28
29
30
# File 'lib/3llo/interface.rb', line 28

def output
  @output
end

Instance Method Details



19
20
21
# File 'lib/3llo/interface.rb', line 19

def print(str)
  output.print(str)
end


7
8
9
10
11
12
# File 'lib/3llo/interface.rb', line 7

def print_frame
  print_line("")
  data = yield
  print_line("")
  data
end


14
15
16
# File 'lib/3llo/interface.rb', line 14

def print_line(str)
  output.puts(str)
end

#prompt(message) ⇒ Object



23
24
25
26
# File 'lib/3llo/interface.rb', line 23

def prompt(message)
  print("Enter list ID to be moved to: ")
  input.gets.chomp
end