Class: Humble::ResultSet
- Inherits:
-
Object
- Object
- Humble::ResultSet
- Includes:
- Enumerable
- Defined in:
- lib/humble/result_set.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(rows, mapper) ⇒ ResultSet
constructor
A new instance of ResultSet.
Constructor Details
#initialize(rows, mapper) ⇒ ResultSet
Returns a new instance of ResultSet.
5 6 7 8 |
# File 'lib/humble/result_set.rb', line 5 def initialize(rows, mapper) @rows = rows @mapper = mapper end |
Instance Method Details
#each(&block) ⇒ Object
10 11 12 13 14 |
# File 'lib/humble/result_set.rb', line 10 def each(&block) @rows.each do |row| block.call(@mapper.map_from(row)) end end |