Class: Markup::Rails::Processors::Base
- Inherits:
-
Object
- Object
- Markup::Rails::Processors::Base
- Defined in:
- lib/markup/rails/processors/base.rb
Overview
To add a new markup processor you have to inherit from this class. In this class you have to add to_* methods for available output formats.
Example:
# lib/markup/rails/processors/obscure_processor.rb
require "markup/rails/processors/base"
module Markup
module Rails
module Processors
class ObscureProcessor < Base
def to_html
processor.to_html
end
private
def processor
Obscure.new(@string)
end
end
end
end
end
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(string, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(string, options = {}) ⇒ Base
Returns a new instance of Base.
34 35 36 37 |
# File 'lib/markup/rails/processors/base.rb', line 34 def initialize(string, = {}) @string = string @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
32 33 34 |
# File 'lib/markup/rails/processors/base.rb', line 32 def @options end |
#string ⇒ Object
Returns the value of attribute string.
32 33 34 |
# File 'lib/markup/rails/processors/base.rb', line 32 def string @string end |