Class: Shuttlecraft::Test::StubMothership
- Inherits:
-
Object
- Object
- Shuttlecraft::Test::StubMothership
- Defined in:
- lib/shuttlecraft/test.rb
Instance Method Summary collapse
-
#initialize ⇒ StubMothership
constructor
A new instance of StubMothership.
- #read_all(template) ⇒ Object
- #take(*args) ⇒ Object
- #write(*args) ⇒ Object
Constructor Details
#initialize ⇒ StubMothership
Returns a new instance of StubMothership.
14 15 16 |
# File 'lib/shuttlecraft/test.rb', line 14 def initialize @tuples = [] end |
Instance Method Details
#read_all(template) ⇒ Object
26 27 28 29 30 |
# File 'lib/shuttlecraft/test.rb', line 26 def read_all(template) @tuples.map{|t,r| t}.select do |t| template[1].nil? or template[1] === t[1] end end |
#take(*args) ⇒ Object
22 23 24 |
# File 'lib/shuttlecraft/test.rb', line 22 def take(*args) @tuples.delete(args) end |
#write(*args) ⇒ Object
18 19 20 |
# File 'lib/shuttlecraft/test.rb', line 18 def write(*args) @tuples << args end |