Class: Relaxo::QueryServer::MockShell
- Defined in:
- lib/relaxo/query_server/shell.rb
Overview
Used primarily for testing, allows the input and output of the server to be provided directly.
Instance Attribute Summary
Attributes inherited from Shell
Instance Method Summary collapse
-
#initialize ⇒ MockShell
constructor
A new instance of MockShell.
- #read_object ⇒ Object
- #write_object(object) ⇒ Object
Methods inherited from Shell
Constructor Details
#initialize ⇒ MockShell
Returns a new instance of MockShell.
85 86 87 |
# File 'lib/relaxo/query_server/shell.rb', line 85 def initialize super [], [] end |
Instance Method Details
#read_object ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/relaxo/query_server/shell.rb', line 89 def read_object if @input.size > 0 @input.shift else raise EOFError.new("No more objects") end end |
#write_object(object) ⇒ Object
97 98 99 |
# File 'lib/relaxo/query_server/shell.rb', line 97 def write_object object @output << object end |