Class: KhanAcademy::Topic
- Inherits:
-
Object
- Object
- KhanAcademy::Topic
- Defined in:
- lib/rubykhan.rb
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
24 25 26 27 28 29 30 |
# File 'lib/rubykhan.rb', line 24 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.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def assessment_progress_key @assessment_progress_key end |
#background_image_caption ⇒ Object (readonly)
Returns the value of attribute background_image_caption.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def background_image_caption @background_image_caption end |
#background_image_url ⇒ Object (readonly)
Returns the value of attribute background_image_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def background_image_url @background_image_url end |
#backup_timestamp ⇒ Object (readonly)
Returns the value of attribute backup_timestamp.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def end |
#child_data ⇒ Object (readonly)
Returns the value of attribute child_data.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def child_data @child_data end |
#children ⇒ Object (readonly)
Returns the value of attribute children.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def children @children end |
#content_kind ⇒ Object (readonly)
Returns the value of attribute content_kind.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def content_kind @content_kind end |
#current_revision_key ⇒ Object (readonly)
Returns the value of attribute current_revision_key.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def current_revision_key @current_revision_key end |
#deleted ⇒ Object (readonly)
Returns the value of attribute deleted.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def deleted @deleted end |
#deleted_mod_time ⇒ Object (readonly)
Returns the value of attribute deleted_mod_time.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def deleted_mod_time @deleted_mod_time end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def description @description end |
#domain_slug ⇒ Object (readonly)
Returns the value of attribute domain_slug.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def domain_slug @domain_slug end |
#extended_slug ⇒ Object (readonly)
Returns the value of attribute extended_slug.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def extended_slug @extended_slug end |
#facebook_url ⇒ Object (readonly)
Returns the value of attribute facebook_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def facebook_url @facebook_url end |
#gplus_url ⇒ Object (readonly)
Returns the value of attribute gplus_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def gplus_url @gplus_url end |
#hide ⇒ Object (readonly)
Returns the value of attribute hide.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def hide @hide end |
#icon_src ⇒ Object (readonly)
Returns the value of attribute icon_src.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def icon_src @icon_src end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def id @id end |
#in_knowledge_map ⇒ Object (readonly)
Returns the value of attribute in_knowledge_map.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def in_knowledge_map @in_knowledge_map end |
#in_topic_browser ⇒ Object (readonly)
Returns the value of attribute in_topic_browser.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def in_topic_browser @in_topic_browser end |
#ka_url ⇒ Object (readonly)
Returns the value of attribute ka_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def ka_url @ka_url end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def kind @kind end |
#logo_image_url ⇒ Object (readonly)
Returns the value of attribute logo_image_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def logo_image_url @logo_image_url end |
#node_slug ⇒ Object (readonly)
Returns the value of attribute node_slug.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def node_slug @node_slug end |
#old_key_name ⇒ Object (readonly)
Returns the value of attribute old_key_name.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def old_key_name @old_key_name end |
#relative_url ⇒ Object (readonly)
Returns the value of attribute relative_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def relative_url @relative_url end |
#render_type ⇒ Object (readonly)
Returns the value of attribute render_type.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def render_type @render_type end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def sha @sha end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def slug @slug end |
#standalone_title ⇒ Object (readonly)
Returns the value of attribute standalone_title.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def standalone_title @standalone_title end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def title @title end |
#topic_page_url ⇒ Object (readonly)
Returns the value of attribute topic_page_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def topic_page_url @topic_page_url end |
#translated_description ⇒ Object (readonly)
Returns the value of attribute translated_description.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def translated_description @translated_description end |
#translated_standalone_title ⇒ Object (readonly)
Returns the value of attribute translated_standalone_title.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def translated_standalone_title @translated_standalone_title end |
#translated_title ⇒ Object (readonly)
Returns the value of attribute translated_title.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def translated_title @translated_title end |
#twitter_url ⇒ Object (readonly)
Returns the value of attribute twitter_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def twitter_url @twitter_url end |
#web_url ⇒ Object (readonly)
Returns the value of attribute web_url.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def web_url @web_url end |
#x_pos ⇒ Object (readonly)
Returns the value of attribute x_pos.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def x_pos @x_pos end |
#y_pos ⇒ Object (readonly)
Returns the value of attribute y_pos.
22 23 24 |
# File 'lib/rubykhan.rb', line 22 def y_pos @y_pos end |
Class Method Details
.all ⇒ Object
38 39 40 41 42 |
# File 'lib/rubykhan.rb', line 38 def self.all uri = "http://www.khanacademy.org/api/v1/topictree" = HTTParty.get(uri).to_hash values(, 'slug') end |
.get_info(topic) ⇒ Object
32 33 34 35 36 |
# File 'lib/rubykhan.rb', line 32 def self.get_info(topic) uri = "http://www.KhanAcademy.org/api/v1/topic/#{topic}" = HTTParty.get(uri) new() end |