Class: KhanAcademy::Playlist

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/rubykhan.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Playlist

Returns a new instance of Playlist.



53
54
55
56
57
58
59
# File 'lib/rubykhan.rb', line 53

def initialize(options)
	options.each do |key, value|
		unless key.to_s.empty?
			eval("@#{key}=#{value.inspect}")
		end
	end
end

Instance Attribute Details

#all_assessment_item_keysObject (readonly)

Returns the value of attribute all_assessment_item_keys.



51
52
53
# File 'lib/rubykhan.rb', line 51

def all_assessment_item_keys
  @all_assessment_item_keys
end

#assessment_item_tagsObject (readonly)

Returns the value of attribute assessment_item_tags.



51
52
53
# File 'lib/rubykhan.rb', line 51

def assessment_item_tags
  @assessment_item_tags
end

#assessment_itemsObject (readonly)

Returns the value of attribute assessment_items.



51
52
53
# File 'lib/rubykhan.rb', line 51

def assessment_items
  @assessment_items
end

#author_nameObject (readonly)

Returns the value of attribute author_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def author_name
  @author_name
end

#author_namesObject (readonly)

Returns the value of attribute author_names.



51
52
53
# File 'lib/rubykhan.rb', line 51

def author_names
  @author_names
end

#backup_timestampObject (readonly)

Returns the value of attribute backup_timestamp.



51
52
53
# File 'lib/rubykhan.rb', line 51

def backup_timestamp
  @backup_timestamp
end

#content_kiObject (readonly)

Returns the value of attribute content_ki.



51
52
53
# File 'lib/rubykhan.rb', line 51

def content_ki
  @content_ki
end

#content_kindObject (readonly)

Returns the value of attribute content_kind.



51
52
53
# File 'lib/rubykhan.rb', line 51

def content_kind
  @content_kind
end

#coversObject (readonly)

Returns the value of attribute covers.



51
52
53
# File 'lib/rubykhan.rb', line 51

def covers
  @covers
end

#creation_dateObject (readonly)

Returns the value of attribute creation_date.



51
52
53
# File 'lib/rubykhan.rb', line 51

def creation_date
  @creation_date
end

Returns the value of attribute curated_related_videos.



51
52
53
# File 'lib/rubykhan.rb', line 51

def curated_related_videos
  @curated_related_videos
end

#current_revision_keyObject (readonly)

Returns the value of attribute current_revision_key.



51
52
53
# File 'lib/rubykhan.rb', line 51

def current_revision_key
  @current_revision_key
end

#date_addedObject (readonly)

Returns the value of attribute date_added.



51
52
53
# File 'lib/rubykhan.rb', line 51

def date_added
  @date_added
end

#deletedObject (readonly)

Returns the value of attribute deleted.



51
52
53
# File 'lib/rubykhan.rb', line 51

def deleted
  @deleted
end

#deleted_mod_timeObject (readonly)

Returns the value of attribute deleted_mod_time.



51
52
53
# File 'lib/rubykhan.rb', line 51

def deleted_mod_time
  @deleted_mod_time
end

#descriptionObject (readonly)

Returns the value of attribute description.



51
52
53
# File 'lib/rubykhan.rb', line 51

def description
  @description
end

#description_htmlObject (readonly)

Returns the value of attribute description_html.



51
52
53
# File 'lib/rubykhan.rb', line 51

def description_html
  @description_html
end

#display_nameObject (readonly)

Returns the value of attribute display_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def display_name
  @display_name
end

#download_urlsObject (readonly)

Returns the value of attribute download_urls.



51
52
53
# File 'lib/rubykhan.rb', line 51

def download_urls
  @download_urls
end

#durationObject (readonly)

Returns the value of attribute duration.



51
52
53
# File 'lib/rubykhan.rb', line 51

def duration
  @duration
end

#edit_slugObject (readonly)

Returns the value of attribute edit_slug.



51
52
53
# File 'lib/rubykhan.rb', line 51

def edit_slug
  @edit_slug
end

#extra_propertiesObject (readonly)

Returns the value of attribute extra_properties.



51
52
53
# File 'lib/rubykhan.rb', line 51

def extra_properties
  @extra_properties
end

#file_nameObject (readonly)

Returns the value of attribute file_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def file_name
  @file_name
end

#global_idObject (readonly)

Returns the value of attribute global_id.



51
52
53
# File 'lib/rubykhan.rb', line 51

def global_id
  @global_id
end

#h_positionObject (readonly)

Returns the value of attribute h_position.



51
52
53
# File 'lib/rubykhan.rb', line 51

def h_position
  @h_position
end

#has_questionsObject (readonly)

Returns the value of attribute has_questions.



51
52
53
# File 'lib/rubykhan.rb', line 51

def has_questions
  @has_questions
end

#idObject (readonly)

Returns the value of attribute id.



51
52
53
# File 'lib/rubykhan.rb', line 51

def id
  @id
end

#image_urlObject (readonly)

Returns the value of attribute image_url.



51
52
53
# File 'lib/rubykhan.rb', line 51

def image_url
  @image_url
end

#image_url_256Object (readonly)

Returns the value of attribute image_url_256.



51
52
53
# File 'lib/rubykhan.rb', line 51

def image_url_256
  @image_url_256
end

#ka_urlObject (readonly)

Returns the value of attribute ka_url.



51
52
53
# File 'lib/rubykhan.rb', line 51

def ka_url
  @ka_url
end

#ka_user_licenseObject (readonly)

Returns the value of attribute ka_user_license.



51
52
53
# File 'lib/rubykhan.rb', line 51

def ka_user_license
  @ka_user_license
end

#keywordsObject (readonly)

Returns the value of attribute keywords.



51
52
53
# File 'lib/rubykhan.rb', line 51

def keywords
  @keywords
end

#kindObject (readonly)

Returns the value of attribute kind.



51
52
53
# File 'lib/rubykhan.rb', line 51

def kind
  @kind
end

#liveObject (readonly)

Returns the value of attribute live.



51
52
53
# File 'lib/rubykhan.rb', line 51

def live
  @live
end

#nameObject (readonly)

Returns the value of attribute name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def name
  @name
end

#node_slugObject (readonly)

Returns the value of attribute node_slug.



51
52
53
# File 'lib/rubykhan.rb', line 51

def node_slug
  @node_slug
end

#positionObject (readonly)

Returns the value of attribute position.



51
52
53
# File 'lib/rubykhan.rb', line 51

def position
  @position
end

#prerequisitesObject (readonly)

Returns the value of attribute prerequisites.



51
52
53
# File 'lib/rubykhan.rb', line 51

def prerequisites
  @prerequisites
end

#pretty_display_nameObject (readonly)

Returns the value of attribute pretty_display_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def pretty_display_name
  @pretty_display_name
end

#problem_typesObject (readonly)

Returns the value of attribute problem_types.



51
52
53
# File 'lib/rubykhan.rb', line 51

def problem_types
  @problem_types
end

#progress_keyObject (readonly)

Returns the value of attribute progress_key.



51
52
53
# File 'lib/rubykhan.rb', line 51

def progress_key
  @progress_key
end

#readable_idObject (readonly)

Returns the value of attribute readable_id.



51
52
53
# File 'lib/rubykhan.rb', line 51

def readable_id
  @readable_id
end

#relative_urlObject (readonly)

Returns the value of attribute relative_url.



51
52
53
# File 'lib/rubykhan.rb', line 51

def relative_url
  @relative_url
end

#seconds_per_fast_problemObject (readonly)

Returns the value of attribute seconds_per_fast_problem.



51
52
53
# File 'lib/rubykhan.rb', line 51

def seconds_per_fast_problem
  @seconds_per_fast_problem
end

#shaObject (readonly)

Returns the value of attribute sha.



51
52
53
# File 'lib/rubykhan.rb', line 51

def sha
  @sha
end

#sha1Object (readonly)

Returns the value of attribute sha1.



51
52
53
# File 'lib/rubykhan.rb', line 51

def sha1
  @sha1
end

#short_display_nameObject (readonly)

Returns the value of attribute short_display_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def short_display_name
  @short_display_name
end

#summativeObject (readonly)

Returns the value of attribute summative.



51
52
53
# File 'lib/rubykhan.rb', line 51

def summative
  @summative
end

#tagsObject (readonly)

Returns the value of attribute tags.



51
52
53
# File 'lib/rubykhan.rb', line 51

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



51
52
53
# File 'lib/rubykhan.rb', line 51

def title
  @title
end

#tracking_document_urlObject (readonly)

Returns the value of attribute tracking_document_url.



51
52
53
# File 'lib/rubykhan.rb', line 51

def tracking_document_url
  @tracking_document_url
end

#translated_descriptionObject (readonly)

Returns the value of attribute translated_description.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_description
  @translated_description
end

#translated_description_htmlObject (readonly)

Returns the value of attribute translated_description_html.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_description_html
  @translated_description_html
end

#translated_display_nameObject (readonly)

Returns the value of attribute translated_display_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_display_name
  @translated_display_name
end

#translated_pretty_display_nameObject (readonly)

Returns the value of attribute translated_pretty_display_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_pretty_display_name
  @translated_pretty_display_name
end

#translated_short_display_nameObject (readonly)

Returns the value of attribute translated_short_display_name.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_short_display_name
  @translated_short_display_name
end

#translated_titleObject (readonly)

Returns the value of attribute translated_title.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_title
  @translated_title
end

#translated_youtube_idObject (readonly)

Returns the value of attribute translated_youtube_id.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_youtube_id
  @translated_youtube_id
end

#translated_youtube_langObject (readonly)

Returns the value of attribute translated_youtube_lang.



51
52
53
# File 'lib/rubykhan.rb', line 51

def translated_youtube_lang
  @translated_youtube_lang
end

#tutorial_onlyObject (readonly)

Returns the value of attribute tutorial_only.



51
52
53
# File 'lib/rubykhan.rb', line 51

def tutorial_only
  @tutorial_only
end

#urlObject (readonly)

Returns the value of attribute url.



51
52
53
# File 'lib/rubykhan.rb', line 51

def url
  @url
end

#uses_assessment_itemsObject (readonly)

Returns the value of attribute uses_assessment_items.



51
52
53
# File 'lib/rubykhan.rb', line 51

def uses_assessment_items
  @uses_assessment_items
end

#v_positionObject (readonly)

Returns the value of attribute v_position.



51
52
53
# File 'lib/rubykhan.rb', line 51

def v_position
  @v_position
end

#youtube_idObject (readonly)

Returns the value of attribute youtube_id.



51
52
53
# File 'lib/rubykhan.rb', line 51

def youtube_id
  @youtube_id
end

Class Method Details

.get_exercises(topic) ⇒ Object



61
62
63
64
65
# File 'lib/rubykhan.rb', line 61

def self.get_exercises(topic)
	uri = "http://www.KhanAcademy.org/api/v1/playlists/#{topic}/exercises"
	options = KhanAcademy::Playlist.get(uri)
	options.collect {|json| new(json)}
end

.get_videos(topic) ⇒ Object



67
68
69
70
71
# File 'lib/rubykhan.rb', line 67

def self.get_videos(topic)
	uri = "http://www.KhanAcademy.org/api/v1/playlists/#{topic}/videos"
	options = KhanAcademy::Playlist.get(uri)
	options.collect {|json| new(json)}
end