Class: Lingq::Lesson
- Inherits:
-
Object
- Object
- Lingq::Lesson
- Defined in:
- lib/lingq/lesson.rb
Instance Attribute Summary collapse
-
#audio_url ⇒ Object
readonly
Returns the value of attribute audio_url.
-
#cards_count ⇒ Object
readonly
Returns the value of attribute cards_count.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#lingq_client ⇒ Object
readonly
Returns the value of attribute lingq_client.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(client, language_code, json) ⇒ Lesson
constructor
A new instance of Lesson.
- #words ⇒ Object
Constructor Details
#initialize(client, language_code, json) ⇒ Lesson
Returns a new instance of Lesson.
4 5 6 7 8 9 10 11 12 |
# File 'lib/lingq/lesson.rb', line 4 def initialize(client,language_code,json) @lingq_client = client @language = language_code @audio_url = json["audio_url"] @image_url = json["image_url"] @id = json["id"] @cards_count = json["cards_count"] @title = json["title"] end |
Instance Attribute Details
#audio_url ⇒ Object (readonly)
Returns the value of attribute audio_url.
3 4 5 |
# File 'lib/lingq/lesson.rb', line 3 def audio_url @audio_url end |
#cards_count ⇒ Object (readonly)
Returns the value of attribute cards_count.
3 4 5 |
# File 'lib/lingq/lesson.rb', line 3 def cards_count @cards_count end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/lingq/lesson.rb', line 3 def id @id end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
3 4 5 |
# File 'lib/lingq/lesson.rb', line 3 def image_url @image_url end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
3 4 5 |
# File 'lib/lingq/lesson.rb', line 3 def language @language end |
#lingq_client ⇒ Object (readonly)
Returns the value of attribute lingq_client.
3 4 5 |
# File 'lib/lingq/lesson.rb', line 3 def lingq_client @lingq_client end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/lingq/lesson.rb', line 3 def title @title end |
Instance Method Details
#words ⇒ Object
14 15 16 17 |
# File 'lib/lingq/lesson.rb', line 14 def words return @words if @words @words = @lingq_client.words_for_lesson(self) end |