Class: String
- Inherits:
-
Object
- Object
- String
- 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_words ⇒ Object
9 10 11 |
# File 'lib/first_gem_anna.rb', line 9 def unique_words self.split.uniq end |
#word_count ⇒ Object
5 6 7 |
# File 'lib/first_gem_anna.rb', line 5 def word_count self.split.count end |