Class: MediaHighlight
- Inherits:
-
Object
- Object
- MediaHighlight
- Defined in:
- lib/media_highlight.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#headline ⇒ Object
Returns the value of attribute headline.
-
#id ⇒ Object
Returns the value of attribute id.
-
#res_400_url ⇒ Object
Returns the value of attribute res_400_url.
-
#res_500_url ⇒ Object
Returns the value of attribute res_500_url.
-
#res_800_url ⇒ Object
Returns the value of attribute res_800_url.
-
#thumb_url ⇒ Object
Returns the value of attribute thumb_url.
-
#type ⇒ Object
Returns the value of attribute type.
-
#v ⇒ Object
Returns the value of attribute v.
Instance Method Summary collapse
-
#initialize(element) ⇒ MediaHighlight
constructor
A new instance of MediaHighlight.
Constructor Details
#initialize(element) ⇒ MediaHighlight
Returns a new instance of MediaHighlight.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/media_highlight.rb', line 7 def initialize(element) @id = element.attributes['id'] @date = element.attributes['date'] @type = element.attributes['type'] @v = element.attributes['v'] @headline = element.elements["headline"].text @duration = element.elements["duration"].text @thumb_url = element.elements["thumb"].text if element.elements["url[@playback_scenario='FLASH_400K_600X338']"] @res_400_url = element.elements["url[@playback_scenario='FLASH_400K_600X338']"].text else @res_400_url = nil end if element.elements["url[@playback_scenario='FLASH_500K_512X288']"] @res_500_url = element.elements["url[@playback_scenario='FLASH_500K_512X288']"].text else @res_500_url = nil end if element.elements["url[@playback_scenario='FLASH_800K_640X360']"] @res_800_url = element.elements["url[@playback_scenario='FLASH_800K_640X360']"].text else @res_800_url = nil end end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/media_highlight.rb', line 3 def date @date end |
#duration ⇒ Object
Returns the value of attribute duration.
4 5 6 |
# File 'lib/media_highlight.rb', line 4 def duration @duration end |
#headline ⇒ Object
Returns the value of attribute headline.
4 5 6 |
# File 'lib/media_highlight.rb', line 4 def headline @headline end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/media_highlight.rb', line 3 def id @id end |
#res_400_url ⇒ Object
Returns the value of attribute res_400_url.
5 6 7 |
# File 'lib/media_highlight.rb', line 5 def res_400_url @res_400_url end |
#res_500_url ⇒ Object
Returns the value of attribute res_500_url.
5 6 7 |
# File 'lib/media_highlight.rb', line 5 def res_500_url @res_500_url end |
#res_800_url ⇒ Object
Returns the value of attribute res_800_url.
5 6 7 |
# File 'lib/media_highlight.rb', line 5 def res_800_url @res_800_url end |
#thumb_url ⇒ Object
Returns the value of attribute thumb_url.
4 5 6 |
# File 'lib/media_highlight.rb', line 4 def thumb_url @thumb_url end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/media_highlight.rb', line 3 def type @type end |
#v ⇒ Object
Returns the value of attribute v.
3 4 5 |
# File 'lib/media_highlight.rb', line 3 def v @v end |