Class: Howcast::Client::Video

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WatchAttrAccessors

attr_accessor, attr_accessors

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


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

def initialize(attributes={})
  attributes.each do |k, v|
    self.send("#{k}=", v) if self.respond_to?(k)
  end
end

Instance Attribute Details

#badgesObject

Returns the value of attribute badges.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def badges
  @badges
end

#category_hierarchyObject

Returns the value of attribute category_hierarchy.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def category_hierarchy
  @category_hierarchy
end

#category_idObject

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_atObject

Returns the value of attribute created_at.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def description
  @description
end

#durationObject

Returns the value of attribute duration.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def duration
  @duration
end

#easy_stepsObject

Returns the value of attribute easy_steps.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def easy_steps
  @easy_steps
end

#embedObject

Returns the value of attribute embed.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def embed
  @embed
end

#filenameObject

Returns the value of attribute filename.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def filename
  @filename
end

#heightObject

Returns the value of attribute height.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def height
  @height
end

#idObject

Returns the value of attribute id.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def id
  @id
end

#ingredientsObject

Returns the value of attribute ingredients.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def ingredients
  @ingredients
end

#markersObject

Returns the value of attribute markers.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def markers
  @markers
end

Returns the value of attribute permalink.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def permalink
  @permalink
end

#ratingObject

Returns the value of attribute rating.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def rating
  @rating
end

Returns the value of attribute related_videos.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def related_videos
  @related_videos
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def thumbnail_url
  @thumbnail_url
end

#titleObject

Returns the value of attribute title.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def title
  @title
end

#usernameObject

Returns the value of attribute username.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def username
  @username
end

#viewsObject

Returns the value of attribute views.



39
40
41
# File 'lib/howcast/client/video.rb', line 39

def views
  @views
end

#widthObject

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

Returns:

  • (Boolean)


62
63
64
# File 'lib/howcast/client/video.rb', line 62

def easy_steps?
  easy_steps == "true"
end