Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/fedux_org_stdlib/core_ext/string/underline.rb,
lib/fedux_org_stdlib/core_ext/string.rb
Overview
String
Instance Method Summary collapse
-
#underline(character: '-') ⇒ String
Underline a string.
Instance Method Details
#underline(character: '-') ⇒ String
Underline a string
11 12 13 14 15 16 17 |
# File 'lib/fedux_org_stdlib/core_ext/string/underline.rb', line 11 def underline(character: '-') result = [] result << self result << gsub(/./, character) result.join("\n") end |