Class: String

Inherits:
Object
  • Object
show all
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

#eachObject



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