Class: MaRuKu::In::Markdown::SpanLevelParser::Rule
- Inherits:
-
Object
- Object
- MaRuKu::In::Markdown::SpanLevelParser::Rule
- Defined in:
- lib/maruku/input/rubypants.rb
Overview
A rule to apply a particular pattern (like double quotes) against a list of strings and MDElements, replacing that pattern with the smartypants version.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#doc ⇒ Object
This is a hack to allow us to build entities.
-
#pattern ⇒ Object
The pattern to search for.
-
#replacement ⇒ Object
The replacement tokens (entities or other instructions).
Instance Method Summary collapse
-
#initialize(pattern, replacement) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(pattern, replacement) ⇒ Rule
Returns a new instance of Rule.
137 138 139 140 |
# File 'lib/maruku/input/rubypants.rb', line 137 def initialize(pattern, replacement) @pattern = pattern @replacement = replacement end |
Instance Attribute Details
#doc ⇒ Object
This is a hack to allow us to build entities.
135 136 137 |
# File 'lib/maruku/input/rubypants.rb', line 135 def doc @doc end |
#pattern ⇒ Object
The pattern to search for
129 130 131 |
# File 'lib/maruku/input/rubypants.rb', line 129 def pattern @pattern end |
#replacement ⇒ Object
The replacement tokens (entities or other instructions)
132 133 134 |
# File 'lib/maruku/input/rubypants.rb', line 132 def replacement @replacement end |