Class: Flickr::ResponseList

Inherits:
Response show all
Includes:
Enumerable
Defined in:
lib/flickr/response_list.rb

Instance Attribute Summary

Attributes inherited from Response

#flickr_type

Instance Method Summary collapse

Methods inherited from Response

build, #marshal_load, #to_hash, #to_s

Constructor Details

#initialize(h, t, a) ⇒ ResponseList

Returns a new instance of ResponseList.



6
# File 'lib/flickr/response_list.rb', line 6

def initialize(h, t, a); super(h, t); @a = a end

Instance Method Details

#[](k) ⇒ Object



8
# File 'lib/flickr/response_list.rb', line 8

def [](k); k.is_a?(Integer) ? @a[k] : super(k) end

#eachObject



10
11
12
# File 'lib/flickr/response_list.rb', line 10

def each
   @a.each { |e| yield e }
end

#inspectObject



16
# File 'lib/flickr/response_list.rb', line 16

def inspect; @a.inspect end

#map!Object



20
21
22
# File 'lib/flickr/response_list.rb', line 20

def map!
  @a = @a.map { |e| yield e }
end

#marshal_dumpObject



24
# File 'lib/flickr/response_list.rb', line 24

def marshal_dump; [@h, @flickr_type, @a] end

#sizeObject Also known as: length



18
# File 'lib/flickr/response_list.rb', line 18

def size; @a.size end

#to_aObject



14
# File 'lib/flickr/response_list.rb', line 14

def to_a; @a end