Class: MediaHighlight

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/media_highlight.rb', line 3

def date
  @date
end

#durationObject

Returns the value of attribute duration.



4
5
6
# File 'lib/media_highlight.rb', line 4

def duration
  @duration
end

#headlineObject

Returns the value of attribute headline.



4
5
6
# File 'lib/media_highlight.rb', line 4

def headline
  @headline
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/media_highlight.rb', line 3

def id
  @id
end

#res_400_urlObject

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_urlObject

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_urlObject

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_urlObject

Returns the value of attribute thumb_url.



4
5
6
# File 'lib/media_highlight.rb', line 4

def thumb_url
  @thumb_url
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/media_highlight.rb', line 3

def type
  @type
end

#vObject

Returns the value of attribute v.



3
4
5
# File 'lib/media_highlight.rb', line 3

def v
  @v
end