Class: NBClass::PhraseArray
- Inherits:
-
Object
- Object
- NBClass::PhraseArray
- Defined in:
- lib/nb_class/phrase_array.rb
Instance Method Summary collapse
- #<<(phrase) ⇒ Object
- #[](index) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ PhraseArray
constructor
A new instance of PhraseArray.
- #size ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ PhraseArray
Returns a new instance of PhraseArray.
5 6 7 |
# File 'lib/nb_class/phrase_array.rb', line 5 def initialize @phrase_array = [] end |
Instance Method Details
#<<(phrase) ⇒ Object
8 9 10 |
# File 'lib/nb_class/phrase_array.rb', line 8 def <<(phrase) @phrase_array << Utils.break_phrase_in_word_array(phrase) end |
#[](index) ⇒ Object
14 15 16 |
# File 'lib/nb_class/phrase_array.rb', line 14 def [](index) @phrase_array[index] end |
#each(&block) ⇒ Object
17 18 19 |
# File 'lib/nb_class/phrase_array.rb', line 17 def each(&block) @phrase_array.each(&block) end |
#size ⇒ Object
11 12 13 |
# File 'lib/nb_class/phrase_array.rb', line 11 def size @phrase_array.size end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/nb_class/phrase_array.rb', line 20 def to_s @phrase_array.to_s end |