class RenderAsMarkdown::Header

Public Class Methods

new(title, char) click to toggle source
# File lib/render-as-markdown/header.rb, line 4
def initialize title, char
  @title = [title.to_s.strip, " "].max
  @char  = char.to_s
end

Public Instance Methods

render() click to toggle source
# File lib/render-as-markdown/header.rb, line 9
def render
  length = [@title.length, 1].max
  @title << "\n" << @char*length << "\n"*2
end
Also aliased as: to_s
to_s()
Alias for: render