Class: WeatherHacks::LWWS::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/weatherhacks/lwws.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elt) ⇒ Image

Returns a new instance of Image.



59
60
61
62
63
64
65
# File 'lib/weatherhacks/lwws.rb', line 59

def initialize(elt)
  @title = elt.elements["title"].text
  @link = URI.parse(elt.elements["link"].text)
  @url = URI.parse(elt.elements["url"].text)
  @width = elt.elements["width"].text.to_i
  @height = elt.elements["height"].text.to_i
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



58
59
60
# File 'lib/weatherhacks/lwws.rb', line 58

def height
  @height
end

Returns the value of attribute link.



58
59
60
# File 'lib/weatherhacks/lwws.rb', line 58

def link
  @link
end

#titleObject (readonly)

Returns the value of attribute title.



58
59
60
# File 'lib/weatherhacks/lwws.rb', line 58

def title
  @title
end

#urlObject (readonly)

Returns the value of attribute url.



58
59
60
# File 'lib/weatherhacks/lwws.rb', line 58

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



58
59
60
# File 'lib/weatherhacks/lwws.rb', line 58

def width
  @width
end