Class: Howcast::Client::Video
- Inherits:
-
Object
- Object
- Howcast::Client::Video
- Extended by:
- WatchAttrAccessors
- Includes:
- XmlMethods
- Defined in:
- lib/howcast/client/video.rb
Instance Attribute Summary collapse
-
#ads_allowed ⇒ Object
Returns the value of attribute ads_allowed.
-
#badges ⇒ Object
Returns the value of attribute badges.
-
#category_hierarchy ⇒ Object
Returns the value of attribute category_hierarchy.
-
#category_id ⇒ Object
Returns the value of attribute category_id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#easy_steps ⇒ Object
Returns the value of attribute easy_steps.
-
#embed ⇒ Object
Returns the value of attribute embed.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#ingredients ⇒ Object
Returns the value of attribute ingredients.
-
#markers ⇒ Object
Returns the value of attribute markers.
-
#mature_content ⇒ Object
Returns the value of attribute mature_content.
-
#permalink ⇒ Object
Returns the value of attribute permalink.
-
#playlist_memberships ⇒ Object
Returns the value of attribute playlist_memberships.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#related_videos ⇒ Object
Returns the value of attribute related_videos.
-
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
-
#username ⇒ Object
Returns the value of attribute username.
-
#views ⇒ Object
Returns the value of attribute views.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #ads_allowed? ⇒ Boolean
-
#easy_steps? ⇒ Boolean
Return true if the video contains easy step by step directions, else false.
-
#initialize(attributes = {}) ⇒ Video
constructor
Creates a new Video object which is used to encapsulate all the attributes available from the Howcast Video API.
- #mature_content? ⇒ Boolean
- #to_param ⇒ Object
Methods included from WatchAttrAccessors
Methods included from XmlMethods
Constructor Details
#initialize(attributes = {}) ⇒ Video
Creates a new Video object which is used to encapsulate all the attributes available from the Howcast Video API
Inputs
-
attributes
– A hash to set the various attributes of the video object
Examples
Initialize a video with title “hello” and rating 20
Video.new :title => "hello", :rating => 20
45 46 47 48 49 |
# File 'lib/howcast/client/video.rb', line 45 def initialize(attributes={}) attributes.each do |k, v| self.send("#{k}=", v) if self.respond_to?(k) end end |
Instance Attribute Details
#ads_allowed ⇒ Object
Returns the value of attribute ads_allowed.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def ads_allowed @ads_allowed end |
#badges ⇒ Object
Returns the value of attribute badges.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def badges @badges end |
#category_hierarchy ⇒ Object
Returns the value of attribute category_hierarchy.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def category_hierarchy @category_hierarchy end |
#category_id ⇒ Object
Returns the value of attribute category_id.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def category_id @category_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def description @description end |
#duration ⇒ Object
Returns the value of attribute duration.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def duration @duration end |
#easy_steps ⇒ Object
Returns the value of attribute easy_steps.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def easy_steps @easy_steps end |
#embed ⇒ Object
Returns the value of attribute embed.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def @embed end |
#filename ⇒ Object
Returns the value of attribute filename.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def filename @filename end |
#height ⇒ Object
Returns the value of attribute height.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def id @id end |
#ingredients ⇒ Object
Returns the value of attribute ingredients.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def ingredients @ingredients end |
#markers ⇒ Object
Returns the value of attribute markers.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def markers @markers end |
#mature_content ⇒ Object
Returns the value of attribute mature_content.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def mature_content @mature_content end |
#permalink ⇒ Object
Returns the value of attribute permalink.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def permalink @permalink end |
#playlist_memberships ⇒ Object
Returns the value of attribute playlist_memberships.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def playlist_memberships @playlist_memberships end |
#rating ⇒ Object
Returns the value of attribute rating.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def @rating end |
#related_videos ⇒ Object
Returns the value of attribute related_videos.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def @related_videos end |
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def thumbnail_url @thumbnail_url end |
#title ⇒ Object
Returns the value of attribute title.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def type @type end |
#username ⇒ Object
Returns the value of attribute username.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def username @username end |
#views ⇒ Object
Returns the value of attribute views.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def views @views end |
#width ⇒ Object
Returns the value of attribute width.
29 30 31 |
# File 'lib/howcast/client/video.rb', line 29 def width @width end |
Instance Method Details
#ads_allowed? ⇒ Boolean
60 61 62 |
# File 'lib/howcast/client/video.rb', line 60 def ads_allowed? ads_allowed == "true" end |
#easy_steps? ⇒ Boolean
Return true if the video contains easy step by step directions, else false
52 53 54 |
# File 'lib/howcast/client/video.rb', line 52 def easy_steps? easy_steps == "true" end |
#mature_content? ⇒ Boolean
56 57 58 |
# File 'lib/howcast/client/video.rb', line 56 def mature_content? mature_content == "true" end |
#to_param ⇒ Object
64 65 66 |
# File 'lib/howcast/client/video.rb', line 64 def to_param id end |