Class: Revver4R::Video
- Inherits:
-
Object
- Object
- Revver4R::Video
- Defined in:
- lib/revver4r.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#content ⇒ Object
Returns the value of attribute content.
-
#credit ⇒ Object
(also: #user)
Returns the value of attribute credit.
-
#description ⇒ Object
Returns the value of attribute description.
-
#license ⇒ Object
Returns the value of attribute license.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#revver_url ⇒ Object
Returns the value of attribute revver_url.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(item) ⇒ Video
constructor
A new instance of Video.
Constructor Details
#initialize(item) ⇒ Video
Returns a new instance of Video.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/revver4r.rb', line 108 def initialize(item) @title = (item/"media:title").first.to_plain_text @description = (item/"media:description").first.to_plain_text @credit = (item/"media:credit").first.to_plain_text @categories = (item/"media:category").first.to_plain_text.split(" ") content_node = (item/"media:content").first @content = VideoContent.new( content_node.attributes["type"], content_node.attributes["url"], content_node.attributes["duration"].to_i) thumnail_node = (item/"media:thumbnail").first @thumbnail = Thumbnail.new( thumnail_node.attributes["url"], thumnail_node.attributes["width"].to_i, thumnail_node.attributes["height"].to_i) @revver_url = (item/"media:player").first.attributes["url"] @rating = (item/"media:rating").first.to_plain_text @license = (item/"creativeCommons:license").first.to_plain_text end |
Instance Attribute Details
#categories ⇒ Object
Returns the value of attribute categories.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def categories @categories end |
#content ⇒ Object
Returns the value of attribute content.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def content @content end |
#credit ⇒ Object Also known as: user
Returns the value of attribute credit.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def credit @credit end |
#description ⇒ Object
Returns the value of attribute description.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def description @description end |
#license ⇒ Object
Returns the value of attribute license.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def license @license end |
#rating ⇒ Object
Returns the value of attribute rating.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def @rating end |
#revver_url ⇒ Object
Returns the value of attribute revver_url.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def revver_url @revver_url end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
106 107 108 |
# File 'lib/revver4r.rb', line 106 def title @title end |