Class: JLDrill::ExampleSentence

Inherits:
Object
  • Object
show all
Defined in:
lib/jldrill/model/ExampleSentence.rb

Overview

An example sentence. Each sentence has a key indicating the vocabulary usage that was searched for to generate the Example Sentence.

Direct Known Subclasses

Tanaka::Sentence, Tatoeba::TatoebaExample

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExampleSentence

Returns a new instance of ExampleSentence.



9
10
11
# File 'lib/jldrill/model/ExampleSentence.rb', line 9

def initialize()
    @key = nil
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



7
8
9
# File 'lib/jldrill/model/ExampleSentence.rb', line 7

def key
  @key
end

Instance Method Details

#nativeLanguageObject

Returns the version of the sentence in the user’s native language Please override in the concrete version



15
16
17
# File 'lib/jldrill/model/ExampleSentence.rb', line 15

def nativeLanguage()
    return ""
end

#nativeOnly_to_sObject



25
26
27
# File 'lib/jldrill/model/ExampleSentence.rb', line 25

def nativeOnly_to_s()
    return "#{key}\n\t#{self.nativeLanguage}"
end

#targetLanguageObject

Returns the version of the sentence in the language being studied Please override in the concrete version



21
22
23
# File 'lib/jldrill/model/ExampleSentence.rb', line 21

def targetLanguage()
    return ""
end

#targetOnly_to_sObject



29
30
31
# File 'lib/jldrill/model/ExampleSentence.rb', line 29

def targetOnly_to_s()
    return "#{key}\n\t#{self.targetLanguage}"
end

#to_sObject



33
34
35
# File 'lib/jldrill/model/ExampleSentence.rb', line 33

def to_s()
    return "#{key}\n\t#{self.targetLanguage}\n\t#{self.nativeLanguage}"
end