Sequel::Model
# File lib/thoth/model/comment.rb, line 84 def body=(body) redcloth = RedCloth.new(body, [:filter_styles]) self[:body] = body self[:body_rendered] = sanitize_html(redcloth.to_html( :refs_textile, :block_textile_lists, :inline_textile_link, :inline_textile_code, :glyphs_textile, :inline_textile_span )) end
Gets the creation time of this comment. If format is provided, the time will be returned as a formatted String. See Time.strftime for details.
# File lib/thoth/model/comment.rb, line 100 def created_at(format = nil) if new? format ? Time.now.strftime(format) : Time.now else format ? self[:created_at].strftime(format) : self[:created_at] end end
Gets the post to which this comment is attached.
# File lib/thoth/model/comment.rb, line 109 def post @post ||= Post[post_id] end
# File lib/thoth/model/comment.rb, line 113 def title=(title) self[:title] = title.strip unless title.nil? end
Gets the time this comment was last updated. If format is provided, the time will be returned as a formatted String. See Time.strftime for details.
# File lib/thoth/model/comment.rb, line 119 def updated_at(format = nil) if new? format ? Time.now.strftime(format) : Time.now else format ? self[:updated_at].strftime(format) : self[:updated_at] end end
Generated with the Darkfish Rdoc Generator 2.