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.



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

def author
  @author
end

#body_to_htmlObject (readonly)

Returns the value of attribute body_to_html.



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

def body_to_html
  @body_to_html
end

#categoriesObject (readonly)

Returns the value of attribute categories.



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

def categories
  @categories
end

#stripped_subtitleObject (readonly)

Returns the value of attribute stripped_subtitle.



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

def stripped_subtitle
  @stripped_subtitle
end

#stripped_subtitle_to_htmlObject (readonly)

Returns the value of attribute stripped_subtitle_to_html.



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

def stripped_subtitle_to_html
  @stripped_subtitle_to_html
end

#subtitleObject (readonly)

Returns the value of attribute subtitle.



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

def subtitle
  @subtitle
end

#subtitle_to_htmlObject (readonly)

Returns the value of attribute subtitle_to_html.



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

def subtitle_to_html
  @subtitle_to_html
end

Instance Method Details

#bodyObject



15
16
17
# File 'lib/tdiary/style.rb', line 15

def body
	@body.dup
end

#body=(str) ⇒ Object



19
20
21
# File 'lib/tdiary/style.rb', line 19

def body=(str)
	@body = str
end

#categories_to_stringObject



41
42
43
44
45
46
# File 'lib/tdiary/style.rb', line 41

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



31
32
33
34
35
# File 'lib/tdiary/style.rb', line 31

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



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

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



37
38
39
# File 'lib/tdiary/style.rb', line 37

def to_s
	to_src
end