Class: LanguageCards::CardSet
- Inherits:
-
Object
- Object
- LanguageCards::CardSet
- Defined in:
- lib/language_cards/models/card_set.rb
Instance Attribute Summary collapse
-
#graphemes ⇒ Object
readonly
Returns the value of attribute graphemes.
Instance Method Summary collapse
-
#initialize(grapheme_hash) ⇒ CardSet
constructor
A new instance of CardSet.
- #label ⇒ Object
- #mode(mode) ⇒ Object
- #sample ⇒ Object
-
#to_s ⇒ Object
So as to not interfere with menu naming as this is not meant to be displayed as a string.
Constructor Details
#initialize(grapheme_hash) ⇒ CardSet
Returns a new instance of CardSet.
9 10 11 |
# File 'lib/language_cards/models/card_set.rb', line 9 def initialize(grapheme_hash) @graphemes = GraphemeBuilder.(grapheme_hash) end |
Instance Attribute Details
#graphemes ⇒ Object (readonly)
Returns the value of attribute graphemes.
8 9 10 |
# File 'lib/language_cards/models/card_set.rb', line 8 def graphemes @graphemes end |
Instance Method Details
#label ⇒ Object
34 35 36 |
# File 'lib/language_cards/models/card_set.rb', line 34 def label [] end |
#mode(mode) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/language_cards/models/card_set.rb', line 17 def mode(mode) case mode when :translate Modes::Translate.new(self) when :typing_practice Modes::TypingPractice.new(self) else raise "Invalid Game Mode!" end end |
#sample ⇒ Object
13 14 15 |
# File 'lib/language_cards/models/card_set.rb', line 13 def sample @graphemes.sample end |
#to_s ⇒ Object
So as to not interfere with menu naming as this is not meant to be displayed as a string.
30 31 32 |
# File 'lib/language_cards/models/card_set.rb', line 30 def to_s "" end |