Class: Lingq::Word
- Inherits:
-
Object
- Object
- Lingq::Word
- Defined in:
- lib/lingq/word.rb
Instance Attribute Summary collapse
-
#fragment ⇒ Object
Returns the value of attribute fragment.
-
#hint ⇒ Object
Returns the value of attribute hint.
-
#id ⇒ Object
Returns the value of attribute id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#status ⇒ Object
Returns the value of attribute status.
-
#term ⇒ Object
Returns the value of attribute term.
Instance Method Summary collapse
- #increment_status! ⇒ Object
-
#initialize(client, language_code, json) ⇒ Word
constructor
A new instance of Word.
- #params ⇒ Object
Constructor Details
#initialize(client, language_code, json) ⇒ Word
Returns a new instance of Word.
4 5 6 7 8 9 10 11 12 |
# File 'lib/lingq/word.rb', line 4 def initialize(client,language_code,json) @lingq_client = client @language = language_code @hint = json["hint"] @term = json["term"] @id = json["id"] @fragment = json["fragment"] @status = json["status"] end |
Instance Attribute Details
#fragment ⇒ Object
Returns the value of attribute fragment.
3 4 5 |
# File 'lib/lingq/word.rb', line 3 def fragment @fragment end |
#hint ⇒ Object
Returns the value of attribute hint.
3 4 5 |
# File 'lib/lingq/word.rb', line 3 def hint @hint end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/lingq/word.rb', line 3 def id @id end |
#language ⇒ Object
Returns the value of attribute language.
3 4 5 |
# File 'lib/lingq/word.rb', line 3 def language @language end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/lingq/word.rb', line 3 def status @status end |
#term ⇒ Object
Returns the value of attribute term.
3 4 5 |
# File 'lib/lingq/word.rb', line 3 def term @term end |
Instance Method Details
#increment_status! ⇒ Object
18 19 20 21 |
# File 'lib/lingq/word.rb', line 18 def increment_status! @status += 1 @lingq_client.update_word!(self) end |
#params ⇒ Object
14 15 16 |
# File 'lib/lingq/word.rb', line 14 def params {:id=>@id,:hint=>@hint,:fragment=>@fragment,:status=>@status} end |