Class: Flickr::Size

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(label, width, height, source, url) ⇒ Size

Returns a new instance of Size.



345
346
347
348
349
350
351
# File 'lib/flickr/base.rb', line 345

def initialize(label,width,height,source,url)
  @label = label
  @width = width
  @height = height
  @source = source
  @url = url
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



343
344
345
# File 'lib/flickr/base.rb', line 343

def height
  @height
end

#labelObject (readonly)

Returns the value of attribute label.



343
344
345
# File 'lib/flickr/base.rb', line 343

def label
  @label
end

#sourceObject (readonly)

Returns the value of attribute source.



343
344
345
# File 'lib/flickr/base.rb', line 343

def source
  @source
end

#urlObject (readonly)

Returns the value of attribute url.



343
344
345
# File 'lib/flickr/base.rb', line 343

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



343
344
345
# File 'lib/flickr/base.rb', line 343

def width
  @width
end

Class Method Details

.from_xml(xml) ⇒ Object



353
354
355
356
357
# File 'lib/flickr/base.rb', line 353

def self.from_xml(xml)
  att = xml.attributes
  return Flickr::Size.new(att['label'],att['width'].to_i,
                          att['height'].to_i,att['source'],att['url'])
end