Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/umlify/extension.rb
Overview
Extends the String to add a String#each method so that strings can be read just like files, line-by-line.
Instance Method Summary collapse
Instance Method Details
#each ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/umlify/extension.rb', line 8 def each self.split(/\n/).each do |line| yield line end end |