Class: Howcast::Client::Video

Inherits:
Object
  • Object
show all
Extended by:
WatchAttrAccessors
Includes:
XmlMethods
Defined in:
lib/howcast/client/video.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WatchAttrAccessors

attr_accessor, attr_accessors

Methods included from XmlMethods

#to_doc, #to_xml

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_allowedObject

Returns the value of attribute ads_allowed.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def ads_allowed
  @ads_allowed
end

#badgesObject

Returns the value of attribute badges.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def badges
  @badges
end

#category_hierarchyObject

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_idObject

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_atObject

Returns the value of attribute created_at.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def description
  @description
end

#durationObject

Returns the value of attribute duration.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def duration
  @duration
end

#easy_stepsObject

Returns the value of attribute easy_steps.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def easy_steps
  @easy_steps
end

#embedObject

Returns the value of attribute embed.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def embed
  @embed
end

#filenameObject

Returns the value of attribute filename.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def filename
  @filename
end

#heightObject

Returns the value of attribute height.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def height
  @height
end

#idObject

Returns the value of attribute id.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def id
  @id
end

#ingredientsObject

Returns the value of attribute ingredients.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def ingredients
  @ingredients
end

#markersObject

Returns the value of attribute markers.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def markers
  @markers
end

#mature_contentObject

Returns the value of attribute mature_content.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def mature_content
  @mature_content
end

Returns the value of attribute permalink.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def permalink
  @permalink
end

#playlist_membershipsObject

Returns the value of attribute playlist_memberships.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def playlist_memberships
  @playlist_memberships
end

#ratingObject

Returns the value of attribute rating.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def rating
  @rating
end

Returns the value of attribute related_videos.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def related_videos
  @related_videos
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def thumbnail_url
  @thumbnail_url
end

#titleObject

Returns the value of attribute title.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def title
  @title
end

#typeObject

Returns the value of attribute type.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def type
  @type
end

#usernameObject

Returns the value of attribute username.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def username
  @username
end

#viewsObject

Returns the value of attribute views.



29
30
31
# File 'lib/howcast/client/video.rb', line 29

def views
  @views
end

#widthObject

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

Returns:

  • (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

Returns:

  • (Boolean)


52
53
54
# File 'lib/howcast/client/video.rb', line 52

def easy_steps?
  easy_steps == "true"
end

#mature_content?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/howcast/client/video.rb', line 56

def mature_content?
  mature_content == "true"
end

#to_paramObject



64
65
66
# File 'lib/howcast/client/video.rb', line 64

def to_param
  id
end