Class: KhanAcademy::Playlist
- Inherits:
-
Object
- Object
- KhanAcademy::Playlist
- Includes:
- HTTParty
- Defined in:
- lib/rubykhan.rb
Instance Attribute Summary collapse
-
#all_assessment_item_keys ⇒ Object
readonly
Returns the value of attribute all_assessment_item_keys.
-
#assessment_item_tags ⇒ Object
readonly
Returns the value of attribute assessment_item_tags.
-
#assessment_items ⇒ Object
readonly
Returns the value of attribute assessment_items.
-
#author_name ⇒ Object
readonly
Returns the value of attribute author_name.
-
#author_names ⇒ Object
readonly
Returns the value of attribute author_names.
-
#backup_timestamp ⇒ Object
readonly
Returns the value of attribute backup_timestamp.
-
#content_ki ⇒ Object
readonly
Returns the value of attribute content_ki.
-
#content_kind ⇒ Object
readonly
Returns the value of attribute content_kind.
-
#covers ⇒ Object
readonly
Returns the value of attribute covers.
-
#creation_date ⇒ Object
readonly
Returns the value of attribute creation_date.
-
#curated_related_videos ⇒ Object
readonly
Returns the value of attribute curated_related_videos.
-
#current_revision_key ⇒ Object
readonly
Returns the value of attribute current_revision_key.
-
#date_added ⇒ Object
readonly
Returns the value of attribute date_added.
-
#deleted ⇒ Object
readonly
Returns the value of attribute deleted.
-
#deleted_mod_time ⇒ Object
readonly
Returns the value of attribute deleted_mod_time.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#description_html ⇒ Object
readonly
Returns the value of attribute description_html.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#download_urls ⇒ Object
readonly
Returns the value of attribute download_urls.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#edit_slug ⇒ Object
readonly
Returns the value of attribute edit_slug.
-
#extra_properties ⇒ Object
readonly
Returns the value of attribute extra_properties.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#global_id ⇒ Object
readonly
Returns the value of attribute global_id.
-
#h_position ⇒ Object
readonly
Returns the value of attribute h_position.
-
#has_questions ⇒ Object
readonly
Returns the value of attribute has_questions.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#image_url_256 ⇒ Object
readonly
Returns the value of attribute image_url_256.
-
#ka_url ⇒ Object
readonly
Returns the value of attribute ka_url.
-
#ka_user_license ⇒ Object
readonly
Returns the value of attribute ka_user_license.
-
#keywords ⇒ Object
readonly
Returns the value of attribute keywords.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#live ⇒ Object
readonly
Returns the value of attribute live.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#node_slug ⇒ Object
readonly
Returns the value of attribute node_slug.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#prerequisites ⇒ Object
readonly
Returns the value of attribute prerequisites.
-
#pretty_display_name ⇒ Object
readonly
Returns the value of attribute pretty_display_name.
-
#problem_types ⇒ Object
readonly
Returns the value of attribute problem_types.
-
#progress_key ⇒ Object
readonly
Returns the value of attribute progress_key.
-
#readable_id ⇒ Object
readonly
Returns the value of attribute readable_id.
-
#relative_url ⇒ Object
readonly
Returns the value of attribute relative_url.
-
#seconds_per_fast_problem ⇒ Object
readonly
Returns the value of attribute seconds_per_fast_problem.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#sha1 ⇒ Object
readonly
Returns the value of attribute sha1.
-
#short_display_name ⇒ Object
readonly
Returns the value of attribute short_display_name.
-
#summative ⇒ Object
readonly
Returns the value of attribute summative.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#tracking_document_url ⇒ Object
readonly
Returns the value of attribute tracking_document_url.
-
#translated_description ⇒ Object
readonly
Returns the value of attribute translated_description.
-
#translated_description_html ⇒ Object
readonly
Returns the value of attribute translated_description_html.
-
#translated_display_name ⇒ Object
readonly
Returns the value of attribute translated_display_name.
-
#translated_pretty_display_name ⇒ Object
readonly
Returns the value of attribute translated_pretty_display_name.
-
#translated_short_display_name ⇒ Object
readonly
Returns the value of attribute translated_short_display_name.
-
#translated_title ⇒ Object
readonly
Returns the value of attribute translated_title.
-
#translated_youtube_id ⇒ Object
readonly
Returns the value of attribute translated_youtube_id.
-
#translated_youtube_lang ⇒ Object
readonly
Returns the value of attribute translated_youtube_lang.
-
#tutorial_only ⇒ Object
readonly
Returns the value of attribute tutorial_only.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#uses_assessment_items ⇒ Object
readonly
Returns the value of attribute uses_assessment_items.
-
#v_position ⇒ Object
readonly
Returns the value of attribute v_position.
-
#youtube_id ⇒ Object
readonly
Returns the value of attribute youtube_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Playlist
constructor
A new instance of Playlist.
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() .each do |key, value| unless key.to_s.empty? eval("@#{key}=#{value.inspect}") end end end |
Instance Attribute Details
#all_assessment_item_keys ⇒ Object (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_tags ⇒ Object (readonly)
Returns the value of attribute assessment_item_tags.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def @assessment_item_tags end |
#assessment_items ⇒ Object (readonly)
Returns the value of attribute assessment_items.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def assessment_items @assessment_items end |
#author_name ⇒ Object (readonly)
Returns the value of attribute author_name.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def @author_name end |
#author_names ⇒ Object (readonly)
Returns the value of attribute author_names.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def @author_names end |
#backup_timestamp ⇒ Object (readonly)
Returns the value of attribute backup_timestamp.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def @backup_timestamp end |
#content_ki ⇒ Object (readonly)
Returns the value of attribute content_ki.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def content_ki @content_ki end |
#content_kind ⇒ Object (readonly)
Returns the value of attribute content_kind.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def content_kind @content_kind end |
#covers ⇒ Object (readonly)
Returns the value of attribute covers.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def covers @covers end |
#creation_date ⇒ Object (readonly)
Returns the value of attribute creation_date.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def creation_date @creation_date end |
#curated_related_videos ⇒ Object (readonly)
Returns the value of attribute curated_related_videos.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def @curated_related_videos end |
#current_revision_key ⇒ Object (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_added ⇒ Object (readonly)
Returns the value of attribute date_added.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def date_added @date_added end |
#deleted ⇒ Object (readonly)
Returns the value of attribute deleted.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def deleted @deleted end |
#deleted_mod_time ⇒ Object (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 |
#description ⇒ Object (readonly)
Returns the value of attribute description.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def description @description end |
#description_html ⇒ Object (readonly)
Returns the value of attribute description_html.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def description_html @description_html end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def display_name @display_name end |
#download_urls ⇒ Object (readonly)
Returns the value of attribute download_urls.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def download_urls @download_urls end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def duration @duration end |
#edit_slug ⇒ Object (readonly)
Returns the value of attribute edit_slug.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def edit_slug @edit_slug end |
#extra_properties ⇒ Object (readonly)
Returns the value of attribute extra_properties.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def extra_properties @extra_properties end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def file_name @file_name end |
#global_id ⇒ Object (readonly)
Returns the value of attribute global_id.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def global_id @global_id end |
#h_position ⇒ Object (readonly)
Returns the value of attribute h_position.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def h_position @h_position end |
#has_questions ⇒ Object (readonly)
Returns the value of attribute has_questions.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def has_questions @has_questions end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def id @id end |
#image_url ⇒ Object (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_256 ⇒ Object (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_url ⇒ Object (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_license ⇒ Object (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 |
#keywords ⇒ Object (readonly)
Returns the value of attribute keywords.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def keywords @keywords end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def kind @kind end |
#live ⇒ Object (readonly)
Returns the value of attribute live.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def live @live end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def name @name end |
#node_slug ⇒ Object (readonly)
Returns the value of attribute node_slug.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def node_slug @node_slug end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def position @position end |
#prerequisites ⇒ Object (readonly)
Returns the value of attribute prerequisites.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def prerequisites @prerequisites end |
#pretty_display_name ⇒ Object (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_types ⇒ Object (readonly)
Returns the value of attribute problem_types.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def problem_types @problem_types end |
#progress_key ⇒ Object (readonly)
Returns the value of attribute progress_key.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def progress_key @progress_key end |
#readable_id ⇒ Object (readonly)
Returns the value of attribute readable_id.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def readable_id @readable_id end |
#relative_url ⇒ Object (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_problem ⇒ Object (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 |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def sha @sha end |
#sha1 ⇒ Object (readonly)
Returns the value of attribute sha1.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def sha1 @sha1 end |
#short_display_name ⇒ Object (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 |
#summative ⇒ Object (readonly)
Returns the value of attribute summative.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def summative @summative end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def @tags end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def title @title end |
#tracking_document_url ⇒ Object (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_description ⇒ Object (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_html ⇒ Object (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_name ⇒ Object (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_name ⇒ Object (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_name ⇒ Object (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_title ⇒ Object (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_id ⇒ Object (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_lang ⇒ Object (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_only ⇒ Object (readonly)
Returns the value of attribute tutorial_only.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def tutorial_only @tutorial_only end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def url @url end |
#uses_assessment_items ⇒ Object (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_position ⇒ Object (readonly)
Returns the value of attribute v_position.
51 52 53 |
# File 'lib/rubykhan.rb', line 51 def v_position @v_position end |
#youtube_id ⇒ Object (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" = KhanAcademy::Playlist.get(uri) .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" = KhanAcademy::Playlist.get(uri) .collect {|json| new(json)} end |