Module: TDiary::Style::BaseSection

Defined in:
lib/tdiary/style.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



9
10
11
# File 'lib/tdiary/style.rb', line 9

def author
  @author
end

#body_to_htmlObject (readonly)

Returns the value of attribute body_to_html.



11
12
13
# File 'lib/tdiary/style.rb', line 11

def body_to_html
  @body_to_html
end

#categoriesObject (readonly)

Returns the value of attribute categories.



10
11
12
# File 'lib/tdiary/style.rb', line 10

def categories
  @categories
end

#stripped_subtitleObject (readonly)

Returns the value of attribute stripped_subtitle.



10
11
12
# File 'lib/tdiary/style.rb', line 10

def stripped_subtitle
  @stripped_subtitle
end

#stripped_subtitle_to_htmlObject (readonly)

Returns the value of attribute stripped_subtitle_to_html.



11
12
13
# File 'lib/tdiary/style.rb', line 11

def stripped_subtitle_to_html
  @stripped_subtitle_to_html
end

#subtitleObject (readonly)

Returns the value of attribute subtitle.



9
10
11
# File 'lib/tdiary/style.rb', line 9

def subtitle
  @subtitle
end

#subtitle_to_htmlObject (readonly)

Returns the value of attribute subtitle_to_html.



11
12
13
# File 'lib/tdiary/style.rb', line 11

def subtitle_to_html
  @subtitle_to_html
end

Instance Method Details

#bodyObject



13
14
15
# File 'lib/tdiary/style.rb', line 13

def body
	@body.dup
end

#body=(str) ⇒ Object



17
18
19
# File 'lib/tdiary/style.rb', line 17

def body=(str)
	@body = str
end

#categories_to_stringObject



39
40
41
42
43
44
# File 'lib/tdiary/style.rb', line 39

def categories_to_string
	@categories = categories
	cat_str = ""
	categories.each {|cat| cat_str << "[#{cat}]"}
	cat_str << " " unless cat_str.empty?
end

#chtml(date, idx, opt) ⇒ Object



29
30
31
32
33
# File 'lib/tdiary/style.rb', line 29

def chtml(date, idx, opt)
	r = %Q[<%=section_enter_proc( Time.at( #{date.to_i} ) )%>\n]
	r << do_html4( date, idx, opt )
	r << %Q[<%=section_leave_proc( Time.at( #{date.to_i} ) )%>\n]
end

#html4(date, idx, opt) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/tdiary/style.rb', line 21

def html4(date, idx, opt)
	r = %Q[<div class="section">\n]
	r << %Q[<%=section_enter_proc( Time.at( #{date.to_i} ) )%>\n]
	r << do_html4( date, idx, opt )
	r << %Q[<%=section_leave_proc( Time.at( #{date.to_i} ) )%>\n]
	r << "</div>\n"
end

#to_sObject



35
36
37
# File 'lib/tdiary/style.rb', line 35

def to_s
	to_src
end