Class: KhanAcademy::Topic
Instance Attribute Summary collapse
-
#assessment_progress_key ⇒ Object
readonly
Returns the value of attribute assessment_progress_key.
-
#background_image_caption ⇒ Object
readonly
Returns the value of attribute background_image_caption.
-
#background_image_url ⇒ Object
readonly
Returns the value of attribute background_image_url.
-
#backup_timestamp ⇒ Object
readonly
Returns the value of attribute backup_timestamp.
-
#child_data ⇒ Object
readonly
Returns the value of attribute child_data.
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#content_kind ⇒ Object
readonly
Returns the value of attribute content_kind.
-
#current_revision_key ⇒ Object
readonly
Returns the value of attribute current_revision_key.
-
#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.
-
#domain_slug ⇒ Object
readonly
Returns the value of attribute domain_slug.
-
#extended_slug ⇒ Object
readonly
Returns the value of attribute extended_slug.
-
#facebook_url ⇒ Object
readonly
Returns the value of attribute facebook_url.
-
#gplus_url ⇒ Object
readonly
Returns the value of attribute gplus_url.
-
#hide ⇒ Object
readonly
Returns the value of attribute hide.
-
#icon_src ⇒ Object
readonly
Returns the value of attribute icon_src.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#in_knowledge_map ⇒ Object
readonly
Returns the value of attribute in_knowledge_map.
-
#in_topic_browser ⇒ Object
readonly
Returns the value of attribute in_topic_browser.
-
#ka_url ⇒ Object
readonly
Returns the value of attribute ka_url.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#logo_image_url ⇒ Object
readonly
Returns the value of attribute logo_image_url.
-
#node_slug ⇒ Object
readonly
Returns the value of attribute node_slug.
-
#old_key_name ⇒ Object
readonly
Returns the value of attribute old_key_name.
-
#relative_url ⇒ Object
readonly
Returns the value of attribute relative_url.
-
#render_type ⇒ Object
readonly
Returns the value of attribute render_type.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#standalone_title ⇒ Object
readonly
Returns the value of attribute standalone_title.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#topic_page_url ⇒ Object
readonly
Returns the value of attribute topic_page_url.
-
#translated_description ⇒ Object
readonly
Returns the value of attribute translated_description.
-
#translated_standalone_title ⇒ Object
readonly
Returns the value of attribute translated_standalone_title.
-
#translated_title ⇒ Object
readonly
Returns the value of attribute translated_title.
-
#twitter_url ⇒ Object
readonly
Returns the value of attribute twitter_url.
-
#web_url ⇒ Object
readonly
Returns the value of attribute web_url.
-
#x_pos ⇒ Object
readonly
Returns the value of attribute x_pos.
-
#y_pos ⇒ Object
readonly
Returns the value of attribute y_pos.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Topic
constructor
A new instance of Topic.
Constructor Details
#initialize(options) ⇒ Topic
Returns a new instance of Topic.
21 22 23 24 25 26 27 |
# File 'lib/rubykhan.rb', line 21 def initialize() .each do |key, value| unless key.to_s.empty? eval("@#{key}=#{value.inspect}") end end end |
Instance Attribute Details
#assessment_progress_key ⇒ Object (readonly)
Returns the value of attribute assessment_progress_key.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def assessment_progress_key @assessment_progress_key end |
#background_image_caption ⇒ Object (readonly)
Returns the value of attribute background_image_caption.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def @background_image_caption end |
#background_image_url ⇒ Object (readonly)
Returns the value of attribute background_image_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def background_image_url @background_image_url end |
#backup_timestamp ⇒ Object (readonly)
Returns the value of attribute backup_timestamp.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def @backup_timestamp end |
#child_data ⇒ Object (readonly)
Returns the value of attribute child_data.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def child_data @child_data end |
#children ⇒ Object (readonly)
Returns the value of attribute children.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def children @children end |
#content_kind ⇒ Object (readonly)
Returns the value of attribute content_kind.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def content_kind @content_kind end |
#current_revision_key ⇒ Object (readonly)
Returns the value of attribute current_revision_key.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def current_revision_key @current_revision_key end |
#deleted ⇒ Object (readonly)
Returns the value of attribute deleted.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def deleted @deleted end |
#deleted_mod_time ⇒ Object (readonly)
Returns the value of attribute deleted_mod_time.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def deleted_mod_time @deleted_mod_time end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def description @description end |
#domain_slug ⇒ Object (readonly)
Returns the value of attribute domain_slug.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def domain_slug @domain_slug end |
#extended_slug ⇒ Object (readonly)
Returns the value of attribute extended_slug.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def extended_slug @extended_slug end |
#facebook_url ⇒ Object (readonly)
Returns the value of attribute facebook_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def facebook_url @facebook_url end |
#gplus_url ⇒ Object (readonly)
Returns the value of attribute gplus_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def gplus_url @gplus_url end |
#hide ⇒ Object (readonly)
Returns the value of attribute hide.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def hide @hide end |
#icon_src ⇒ Object (readonly)
Returns the value of attribute icon_src.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def icon_src @icon_src end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def id @id end |
#in_knowledge_map ⇒ Object (readonly)
Returns the value of attribute in_knowledge_map.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def in_knowledge_map @in_knowledge_map end |
#in_topic_browser ⇒ Object (readonly)
Returns the value of attribute in_topic_browser.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def in_topic_browser @in_topic_browser end |
#ka_url ⇒ Object (readonly)
Returns the value of attribute ka_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def ka_url @ka_url end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def kind @kind end |
#logo_image_url ⇒ Object (readonly)
Returns the value of attribute logo_image_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def logo_image_url @logo_image_url end |
#node_slug ⇒ Object (readonly)
Returns the value of attribute node_slug.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def node_slug @node_slug end |
#old_key_name ⇒ Object (readonly)
Returns the value of attribute old_key_name.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def old_key_name @old_key_name end |
#relative_url ⇒ Object (readonly)
Returns the value of attribute relative_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def relative_url @relative_url end |
#render_type ⇒ Object (readonly)
Returns the value of attribute render_type.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def render_type @render_type end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def sha @sha end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def slug @slug end |
#standalone_title ⇒ Object (readonly)
Returns the value of attribute standalone_title.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def standalone_title @standalone_title end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def @tags end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def title @title end |
#topic_page_url ⇒ Object (readonly)
Returns the value of attribute topic_page_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def topic_page_url @topic_page_url end |
#translated_description ⇒ Object (readonly)
Returns the value of attribute translated_description.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def translated_description @translated_description end |
#translated_standalone_title ⇒ Object (readonly)
Returns the value of attribute translated_standalone_title.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def translated_standalone_title @translated_standalone_title end |
#translated_title ⇒ Object (readonly)
Returns the value of attribute translated_title.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def translated_title @translated_title end |
#twitter_url ⇒ Object (readonly)
Returns the value of attribute twitter_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def twitter_url @twitter_url end |
#web_url ⇒ Object (readonly)
Returns the value of attribute web_url.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def web_url @web_url end |
#x_pos ⇒ Object (readonly)
Returns the value of attribute x_pos.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def x_pos @x_pos end |
#y_pos ⇒ Object (readonly)
Returns the value of attribute y_pos.
19 20 21 |
# File 'lib/rubykhan.rb', line 19 def y_pos @y_pos end |
Class Method Details
.all(key = "extended_slug") ⇒ Object
35 36 37 38 39 |
# File 'lib/rubykhan.rb', line 35 def self.all(key = "extended_slug") uri = "http://www.khanacademy.org/api/v1/topictree" = KhanAcademy::Playlist.get(uri).to_hash values(, key) end |
.get_info(topic) ⇒ Object
29 30 31 32 33 |
# File 'lib/rubykhan.rb', line 29 def self.get_info(topic) uri = "http://www.KhanAcademy.org/api/v1/topic/#{topic}" = KhanAcademy::Playlist.get(uri) new() end |
.tree ⇒ Object
41 42 43 44 |
# File 'lib/rubykhan.rb', line 41 def self.tree uri = "http://www.khanacademy.org/api/v1/topictree" topictree = KhanAcademy::Playlist.get(uri) end |