Class: Flickr::Count

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(count, fromdate, todate) ⇒ Count

Returns a new instance of Count.



658
659
660
661
662
# File 'lib/flickr/base.rb', line 658

def initialize(count,fromdate,todate)
  @count = count
  @fromdate = fromdate
  @todate = todate
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



657
658
659
# File 'lib/flickr/base.rb', line 657

def count
  @count
end

#fromdateObject (readonly)

Returns the value of attribute fromdate.



657
658
659
# File 'lib/flickr/base.rb', line 657

def fromdate
  @fromdate
end

#todateObject (readonly)

Returns the value of attribute todate.



657
658
659
# File 'lib/flickr/base.rb', line 657

def todate
  @todate
end

Class Method Details

.from_xml(xml) ⇒ Object



664
665
666
667
668
669
# File 'lib/flickr/base.rb', line 664

def self.from_xml(xml)
  att = xml.attributes
  return Flickr::Count.new(att['count'].to_i,
                           Time.at(att['fromdate'].to_i),
                           Time.at(att['todate'].to_i))
end