Class: HTML::Pipeline::TextFilter
- Defined in:
- lib/html/pipeline/text_filter.rb
Direct Known Subclasses
EmailReplyFilter, MarkdownFilter, PlainTextInputFilter, TextileFilter
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from Filter
Instance Method Summary collapse
-
#initialize(text, context = nil, result = nil) ⇒ TextFilter
constructor
A new instance of TextFilter.
Methods inherited from Filter
#base_url, #call, call, #can_access_repo?, #current_user, #doc, #has_ancestor?, #html, #needs, #parse_html, #repository, to_document, to_html, #validate
Constructor Details
#initialize(text, context = nil, result = nil) ⇒ TextFilter
Returns a new instance of TextFilter.
6 7 8 9 10 11 |
# File 'lib/html/pipeline/text_filter.rb', line 6 def initialize(text, context = nil, result = nil) raise TypeError, "text cannot be HTML" if text.is_a?(DocumentFragment) # Ensure that this is always a string @text = text.respond_to?(:to_str) ? text.to_str : text.to_s super nil, context, result end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/html/pipeline/text_filter.rb', line 4 def text @text end |