Class: BootstrapMarkup

Inherits:
Object
  • Object
show all
Defined in:
lib/coursegen/course/helpers/bootstrap_markup.rb

Overview

Class BootstrapMarkup provides methods for using Bootstrap specific HTML markups.

Instance Method Summary collapse

Constructor Details

#initializeBootstrapMarkup

Returns a new instance of BootstrapMarkup.



4
5
6
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 4

def initialize
  @str = ''
end

Instance Method Details

#bigcell_beginObject



52
53
54
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 52

def bigcell_begin
  @str << '<td colspan="3"><h5>'
end

#bigcell_endObject



56
57
58
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 56

def bigcell_end
  @str << '</h5></td>'
end

#cell_beginObject



44
45
46
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 44

def cell_begin
  @str << '<td>'
end

#cell_content(str) ⇒ Object



60
61
62
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 60

def cell_content(str)
  @str << str
end

#cell_endObject



48
49
50
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 48

def cell_end
  @str << '</td>'
end

#header_beginObject



24
25
26
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 24

def header_begin
  @str << '<th>'
end

#header_content(str) ⇒ Object



32
33
34
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 32

def header_content(str)
  @str << str unless str.nil?
end

#header_endObject



28
29
30
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 28

def header_end
  @str << '</th>'
end

#headers_beginObject



16
17
18
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 16

def headers_begin
  @str << '<thead><tr>'
end

#headers_endObject



20
21
22
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 20

def headers_end
  @str << '</tr></thead>'
end

#renderObject



64
65
66
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 64

def render
  @str
end

#row_beginObject



36
37
38
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 36

def row_begin
  @str << '<tr>'
end

#row_endObject



40
41
42
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 40

def row_end
  @str << '</tr>'
end

#table_begin(css_class = 'table-sm') ⇒ Object



8
9
10
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 8

def table_begin(css_class = 'table-sm')
  @str << "<table class=\"table #{css_class}\">"
end

#table_endObject



12
13
14
# File 'lib/coursegen/course/helpers/bootstrap_markup.rb', line 12

def table_end
  @str << '</table>'
end