Class: HtmlSkeleton

Inherits:
Object
  • Object
show all
Defined in:
lib/html_skeleton_table.rb,
lib/html_skeleton.rb,
lib/html_skeleton_calendar.rb

Overview

calendar methods ###################################################

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#day_headerObject (readonly)

Returns the value of attribute day_header.



7
8
9
# File 'lib/html_skeleton_calendar.rb', line 7

def day_header
  @day_header
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Instance Method Details

#calendar(options = {}) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/html_skeleton.rb', line 10

def calendar(options = {}, &)
  set_calendar_options(options, &)
  month = @options[:month]
  frame = month ? "div" : "table"
  body = month ? a_month(@options[:year], month) : a_year(@options[:year])
  %(<#{frame} class="#{@options[:calendar_class]}"> #{body} </#{frame}>)
end

#table(rows, cols, options = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/html_skeleton.rb', line 18

def table(rows, cols, options = {}, &)
  set_table_options(options, &)
  "    <table class=\"\#{@options[:table_class]}\">\n      \#{table_header(cols)}\n      \#{table_body(rows, cols)}\n    </table>\n  TABLE\nend\n"