Class: LearnOpen::Adapters::IOAdapter
- Inherits:
-
Object
- Object
- LearnOpen::Adapters::IOAdapter
- Defined in:
- lib/learn_open/adapters/io_adapter.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #gets ⇒ Object
-
#initialize(input:, output:) ⇒ IOAdapter
constructor
A new instance of IOAdapter.
- #print(*message) ⇒ Object
- #puts(*message) ⇒ Object
Constructor Details
#initialize(input:, output:) ⇒ IOAdapter
Returns a new instance of IOAdapter.
6 7 8 9 |
# File 'lib/learn_open/adapters/io_adapter.rb', line 6 def initialize(input:, output:) @input = input @output = output end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
4 5 6 |
# File 'lib/learn_open/adapters/io_adapter.rb', line 4 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/learn_open/adapters/io_adapter.rb', line 4 def output @output end |
Instance Method Details
#gets ⇒ Object
19 20 21 |
# File 'lib/learn_open/adapters/io_adapter.rb', line 19 def gets input.gets end |
#print(*message) ⇒ Object
15 16 17 |
# File 'lib/learn_open/adapters/io_adapter.rb', line 15 def print(*) output.print(*) end |
#puts(*message) ⇒ Object
11 12 13 |
# File 'lib/learn_open/adapters/io_adapter.rb', line 11 def puts(*) output.puts(*) end |