Class: Revver4R::Video

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#categoriesObject

Returns the value of attribute categories.



106
107
108
# File 'lib/revver4r.rb', line 106

def categories
  @categories
end

#contentObject

Returns the value of attribute content.



106
107
108
# File 'lib/revver4r.rb', line 106

def content
  @content
end

#creditObject Also known as: user

Returns the value of attribute credit.



106
107
108
# File 'lib/revver4r.rb', line 106

def credit
  @credit
end

#descriptionObject

Returns the value of attribute description.



106
107
108
# File 'lib/revver4r.rb', line 106

def description
  @description
end

#licenseObject

Returns the value of attribute license.



106
107
108
# File 'lib/revver4r.rb', line 106

def license
  @license
end

#ratingObject

Returns the value of attribute rating.



106
107
108
# File 'lib/revver4r.rb', line 106

def rating
  @rating
end

#revver_urlObject

Returns the value of attribute revver_url.



106
107
108
# File 'lib/revver4r.rb', line 106

def revver_url
  @revver_url
end

#thumbnailObject

Returns the value of attribute thumbnail.



106
107
108
# File 'lib/revver4r.rb', line 106

def thumbnail
  @thumbnail
end

#titleObject

Returns the value of attribute title.



106
107
108
# File 'lib/revver4r.rb', line 106

def title
  @title
end