Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/rspec_api_blueprint.rb
Instance Method Summary collapse
Instance Method Details
#indent(count, char = ' ') ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/rspec_api_blueprint.rb', line 5 def indent(count, char = ' ') gsub(/([^\n]*)(\n|$)/) do |match| last_iteration = ($1 == "" && $2 == "") line = "" line << (char * count) unless last_iteration line << $1 line << $2 line end end |