Class: Flickr::PhotoList
- Inherits:
-
Array
- Object
- Array
- Flickr::PhotoList
- Defined in:
- lib/flickr/base.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
-
#perpage ⇒ Object
readonly
Returns the value of attribute perpage.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(page, pages, perpage, total) ⇒ PhotoList
constructor
A new instance of PhotoList.
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
#page ⇒ Object (readonly)
Returns the value of attribute page.
511 512 513 |
# File 'lib/flickr/base.rb', line 511 def page @page end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
511 512 513 |
# File 'lib/flickr/base.rb', line 511 def pages @pages end |
#perpage ⇒ Object (readonly)
Returns the value of attribute perpage.
511 512 513 |
# File 'lib/flickr/base.rb', line 511 def perpage @perpage end |
#total ⇒ Object (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 |