Class: Vodpod::RecordSet

Inherits:
Array
  • Object
show all
Defined in:
lib/vodpod/record_set.rb

Instance Method Summary collapse

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

#totalObject



13
14
15
# File 'lib/vodpod/record_set.rb', line 13

def total
  @total
end