Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/aurora_file_processor.rb
Overview
String class: adds two methods
Author: Renee Hendrickson Credit: thanksgiving_dinner.rb answer key
Instance Method Summary collapse
-
#humanize ⇒ Object
A method to replace underscores in variable names with spaces for human reading.
-
#titlecase ⇒ Object
A method that upcases the first letter of each word.
Instance Method Details
#humanize ⇒ Object
A method to replace underscores in variable names with spaces for human reading
31 32 33 |
# File 'lib/aurora_file_processor.rb', line 31 def humanize self.gsub('_',' ').titlecase end |
#titlecase ⇒ Object
A method that upcases the first letter of each word
26 27 28 |
# File 'lib/aurora_file_processor.rb', line 26 def titlecase self.gsub(/\b\w/){|f| f.upcase} end |