Class: MaRuKu::In::Markdown::SpanLevelParser::Rule

Inherits:
Object
  • Object
show all
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

CaptureRule, ReplaceRule

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#docObject

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

#patternObject

The pattern to search for



129
130
131
# File 'lib/maruku/input/rubypants.rb', line 129

def pattern
  @pattern
end

#replacementObject

The replacement tokens (entities or other instructions)



132
133
134
# File 'lib/maruku/input/rubypants.rb', line 132

def replacement
  @replacement
end