Class: Howcast::Client::Video
- Inherits:
-
Object
- Object
- Howcast::Client::Video
- Extended by:
- WatchAttrAccessors
- Defined in:
- lib/howcast/client/video.rb
Instance Attribute Summary collapse
-
#badges ⇒ Object
Returns the value of attribute badges.
-
#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.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#permalink ⇒ Object
Returns the value of attribute permalink.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#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
-
#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.
Methods included from WatchAttrAccessors
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
53 54 55 56 57 |
# File 'lib/howcast/client/video.rb', line 53 def initialize(attributes={}) attributes.each do |k, v| self.send("#{k}=", v) if self.respond_to?(k) end end |
Instance Attribute Details
#badges ⇒ Object
Returns the value of attribute badges.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def badges @badges end |
#category_id ⇒ Object
Returns the value of attribute category_id.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def category_id @category_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def description @description end |
#duration ⇒ Object
Returns the value of attribute duration.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def duration @duration end |
#easy_steps ⇒ Object
Returns the value of attribute easy_steps.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def easy_steps @easy_steps end |
#embed ⇒ Object
Returns the value of attribute embed.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def @embed end |
#height ⇒ Object
Returns the value of attribute height.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def id @id end |
#permalink ⇒ Object
Returns the value of attribute permalink.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def permalink @permalink end |
#rating ⇒ Object
Returns the value of attribute rating.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def @rating end |
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def thumbnail_url @thumbnail_url end |
#title ⇒ Object
Returns the value of attribute title.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def type @type end |
#username ⇒ Object
Returns the value of attribute username.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def username @username end |
#views ⇒ Object
Returns the value of attribute views.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def views @views end |
#width ⇒ Object
Returns the value of attribute width.
39 40 41 |
# File 'lib/howcast/client/video.rb', line 39 def width @width end |
Instance Method Details
#easy_steps? ⇒ Boolean
Return true if the video contains easy step by step directions, else false
60 61 62 |
# File 'lib/howcast/client/video.rb', line 60 def easy_steps? easy_steps == "true" end |