Class: TwitterCldr::Segmentation::PossibleWordList
- Inherits:
-
Object
- Object
- TwitterCldr::Segmentation::PossibleWordList
- Defined in:
- lib/twitter_cldr/segmentation/possible_word_list.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Instance Method Summary collapse
- #[](idx) ⇒ Object
-
#initialize(length) ⇒ PossibleWordList
constructor
A new instance of PossibleWordList.
Constructor Details
#initialize(length) ⇒ PossibleWordList
Returns a new instance of PossibleWordList.
12 13 14 15 |
# File 'lib/twitter_cldr/segmentation/possible_word_list.rb', line 12 def initialize(length) @items = Array.new(length) { PossibleWord.new } @length = length end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
10 11 12 |
# File 'lib/twitter_cldr/segmentation/possible_word_list.rb', line 10 def items @items end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
10 11 12 |
# File 'lib/twitter_cldr/segmentation/possible_word_list.rb', line 10 def length @length end |
Instance Method Details
#[](idx) ⇒ Object
17 18 19 |
# File 'lib/twitter_cldr/segmentation/possible_word_list.rb', line 17 def [](idx) items[idx % length] end |