Class: String

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

Overview

this adds functionality to the existing ruby String class

Instance Method Summary collapse

Instance Method Details

#unique_wordsObject



9
10
11
# File 'lib/first_gem_anna.rb', line 9

def unique_words
  self.split.uniq
end

#word_countObject



5
6
7
# File 'lib/first_gem_anna.rb', line 5

def word_count
  self.split.count
end