Class: LaTeX::Decode::Decoder
- Inherits:
-
Object
- Object
- LaTeX::Decode::Decoder
show all
- Defined in:
- lib/latex/decode/base.rb
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.map ⇒ Object
Returns the value of attribute map.
8
9
10
|
# File 'lib/latex/decode/base.rb', line 8
def map
@map
end
|
.patterns ⇒ Object
Returns the value of attribute patterns.
8
9
10
|
# File 'lib/latex/decode/base.rb', line 8
def patterns
@patterns
end
|
Class Method Details
.decode(string) ⇒ Object
18
19
20
|
# File 'lib/latex/decode/base.rb', line 18
def decode(string)
decode!(string.dup)
end
|
.decode!(string) ⇒ Object
22
23
24
25
26
27
|
# File 'lib/latex/decode/base.rb', line 22
def decode!(string)
patterns.each do |pattern|
string.gsub!(pattern) { |m| [$2,map[$1],$3].compact.join }
end
string
end
|
.inherited(base) ⇒ Object
10
11
12
|
# File 'lib/latex/decode/base.rb', line 10
def inherited(base)
subclasses << base
end
|
.subclasses ⇒ Object
14
15
16
|
# File 'lib/latex/decode/base.rb', line 14
def subclasses
@subclasses ||= []
end
|