Class: FlickRaw::ResponseList

Inherits:
Response
  • Object
show all
Includes:
Enumerable
Defined in:
lib/flickraw/response.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.



39
# File 'lib/flickraw/response.rb', line 39

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

Instance Method Details

#[](k) ⇒ Object



40
# File 'lib/flickraw/response.rb', line 40

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

#eachObject



41
42
43
# File 'lib/flickraw/response.rb', line 41

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

#inspectObject



45
# File 'lib/flickraw/response.rb', line 45

def inspect; @a.inspect end

#map!Object



47
48
49
# File 'lib/flickraw/response.rb', line 47

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

#marshal_dumpObject



50
# File 'lib/flickraw/response.rb', line 50

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

#sizeObject Also known as: length



46
# File 'lib/flickraw/response.rb', line 46

def size; @a.size end

#to_aObject



44
# File 'lib/flickraw/response.rb', line 44

def to_a; @a end