Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/count_words/word_count.rb

Instance Method Summary collapse

Instance Method Details

#word_count(options = {}) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/count_words/word_count.rb', line 2

def word_count(options = {})
  options = {method: :string_split}.merge(options)

  case options[:method]
  when :string_split
    self.split.size
  else
    raise NotImplementedError, "That method is not implimented yet"
  end
end