Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/mark_maker_string.rb

Overview

adds several basic string to markdown conversion methods

Instance Method Summary collapse

Instance Method Details

#bulletObject



32
33
34
# File 'lib/mark_maker_string.rb', line 32

def bullet
  " - #{self}"
end

#codeObject



40
41
42
# File 'lib/mark_maker_string.rb', line 40

def code
  "    #{self}"
end

#code_spanObject



44
45
46
# File 'lib/mark_maker_string.rb', line 44

def code_span
  "#{MarkMaker::CODE_TIC}#{self}#{MarkMaker::CODE_TIC}"
end

#emphasisObject



48
49
50
# File 'lib/mark_maker_string.rb', line 48

def emphasis
  "#{MarkMaker::EMPHASIS}#{self}#{MarkMaker::EMPHASIS}"
end

#header1Object



8
9
10
# File 'lib/mark_maker_string.rb', line 8

def header1
  "#{self}\n#{line_for('=')}"
end

#header2Object



12
13
14
# File 'lib/mark_maker_string.rb', line 12

def header2
  "#{self}\n#{line_for('-')}"
end

#header3Object



16
17
18
# File 'lib/mark_maker_string.rb', line 16

def header3
  "### #{self}"
end

#header4Object



20
21
22
# File 'lib/mark_maker_string.rb', line 20

def header4
  "#### #{self}"
end

#header5Object



24
25
26
# File 'lib/mark_maker_string.rb', line 24

def header5
  "##### #{self}"
end

#header6Object



28
29
30
# File 'lib/mark_maker_string.rb', line 28

def header6
  "###### #{self}"
end

#line_for(underscore) ⇒ Object



4
5
6
# File 'lib/mark_maker_string.rb', line 4

def line_for(underscore)
  underscore * size
end

#number(number = 1) ⇒ Object



36
37
38
# File 'lib/mark_maker_string.rb', line 36

def number(number = 1)
  " #{number}. #{self}"
end

#strongObject



52
53
54
# File 'lib/mark_maker_string.rb', line 52

def strong
  MarkMaker::EMPHASIS * 2 + self + MarkMaker::EMPHASIS * 2
end