Class: ComicVine::CVList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/comic_vine/cv_list.rb

Direct Known Subclasses

CVObjectList, CVSearchList

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resp) ⇒ CVList

Returns a new instance of CVList.



10
11
12
13
14
# File 'lib/comic_vine/cv_list.rb', line 10

def initialize(resp)      
  @total_count = resp['number_of_total_results']
  @offset = resp['offset']
  @limit = resp['limit']
end

Instance Attribute Details

#cvosObject (readonly)

Returns the value of attribute cvos.



8
9
10
# File 'lib/comic_vine/cv_list.rb', line 8

def cvos
  @cvos
end

#limitObject (readonly)

Returns the value of attribute limit.



7
8
9
# File 'lib/comic_vine/cv_list.rb', line 7

def limit
  @limit
end

#offsetObject (readonly)

Returns the value of attribute offset.



6
7
8
# File 'lib/comic_vine/cv_list.rb', line 6

def offset
  @offset
end

#total_countObject (readonly)

Returns the value of attribute total_count.



5
6
7
# File 'lib/comic_vine/cv_list.rb', line 5

def total_count
  @total_count
end

Instance Method Details

#eachObject



16
17
18
# File 'lib/comic_vine/cv_list.rb', line 16

def each
  @cvos.each { |c| yield c }
end

#lastObject



20
21
22
# File 'lib/comic_vine/cv_list.rb', line 20

def last
  @cvos.last
end