Class: WeatherHacks::LWWS::Image
- Inherits:
-
Object
- Object
- WeatherHacks::LWWS::Image
- Defined in:
- lib/weatherhacks/lwws.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(elt) ⇒ Image
constructor
A new instance of Image.
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
#height ⇒ Object (readonly)
Returns the value of attribute height.
58 59 60 |
# File 'lib/weatherhacks/lwws.rb', line 58 def height @height end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
58 59 60 |
# File 'lib/weatherhacks/lwws.rb', line 58 def link @link end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
58 59 60 |
# File 'lib/weatherhacks/lwws.rb', line 58 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
58 59 60 |
# File 'lib/weatherhacks/lwws.rb', line 58 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
58 59 60 |
# File 'lib/weatherhacks/lwws.rb', line 58 def width @width end |