Class: Vodpod::RecordSet
- Inherits:
-
Array
- Object
- Array
- Vodpod::RecordSet
- Defined in:
- lib/vodpod/record_set.rb
Instance Method Summary collapse
-
#initialize(connection, klass, results) ⇒ RecordSet
constructor
An Array, with an extra method #total which returns the total number of records available for the query which generated this recordset.
- #total ⇒ Object
Constructor Details
#initialize(connection, klass, results) ⇒ RecordSet
An Array, with an extra method #total which returns the total number of records available for the query which generated this recordset.
6 7 8 9 10 11 |
# File 'lib/vodpod/record_set.rb', line 6 def initialize(connection, klass, results) @total = results['total'] replace(results['results'].map { |result| klass.new connection, result }) end |
Instance Method Details
#total ⇒ Object
13 14 15 |
# File 'lib/vodpod/record_set.rb', line 13 def total @total end |