Class: MemDB::Out
Instance Method Summary collapse
- #add(res) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ Out
constructor
A new instance of Out.
Constructor Details
#initialize ⇒ Out
Returns a new instance of Out.
7 8 9 |
# File 'lib/mem_db/out.rb', line 7 def initialize @arr = [] end |
Instance Method Details
#add(res) ⇒ Object
11 12 13 14 15 |
# File 'lib/mem_db/out.rb', line 11 def add(res) @arr.push(res) true end |
#each(&block) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/mem_db/out.rb', line 17 def each(&block) return to_enum unless block_given? @arr.each do |values| values.each(&block) end end |