Class: Flickr::PhotoList

Inherits:
Array
  • Object
show all
Defined in:
lib/flickr/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page, pages, perpage, total) ⇒ PhotoList

Returns a new instance of PhotoList.



513
514
515
516
517
518
# File 'lib/flickr/base.rb', line 513

def initialize(page,pages,perpage,total)
	@page = page
	@pages = pages
	@perpage = perpage
	@total = total
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



511
512
513
# File 'lib/flickr/base.rb', line 511

def page
  @page
end

#pagesObject (readonly)

Returns the value of attribute pages.



511
512
513
# File 'lib/flickr/base.rb', line 511

def pages
  @pages
end

#perpageObject (readonly)

Returns the value of attribute perpage.



511
512
513
# File 'lib/flickr/base.rb', line 511

def perpage
  @perpage
end

#totalObject (readonly)

Returns the value of attribute total.



511
512
513
# File 'lib/flickr/base.rb', line 511

def total
  @total
end

Class Method Details

.from_xml(xml, flickr = self) ⇒ Object



520
521
522
523
524
525
526
527
528
# File 'lib/flickr/base.rb', line 520

def self.from_xml(xml,flickr=self)
	att = xml.root.attributes
	list = Flickr::PhotoList.new(att['page'].to_i,att['pages'].to_i,
		att['perpage'].to_i,att['total'].to_i)
	xml.elements['/photos'].each_element do |e|
		list << Flickr::Photo.from_xml(e,flickr)
	end
	return list
end