Class: NBClass::PhraseArray

Inherits:
Object
  • Object
show all
Defined in:
lib/nb_class/phrase_array.rb

Instance Method Summary collapse

Constructor Details

#initializePhraseArray

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

#sizeObject



11
12
13
# File 'lib/nb_class/phrase_array.rb', line 11

def size
  @phrase_array.size
end

#to_sObject



20
21
22
# File 'lib/nb_class/phrase_array.rb', line 20

def to_s
  @phrase_array.to_s
end