class SSMD::Annotations::Annotation
Public Class Methods
new()
click to toggle source
# File lib/ssmd/annotations/annotation.rb, line 17 def initialize raise "implement expecting one argumnt for each capture group in the regex" end
regex()
click to toggle source
# File lib/ssmd/annotations/annotation.rb, line 12 def regex raise "subclass responsibility" end
try(text)
click to toggle source
# File lib/ssmd/annotations/annotation.rb, line 4 def try(text) match = /\A#{regex}\Z/.match text if match new *match.captures end end
Public Instance Methods
combine(annotation)
click to toggle source
# File lib/ssmd/annotations/annotation.rb, line 25 def combine(annotation) raise "combine this annotation with the given annotation of the same type" end
wrap(text)
click to toggle source
# File lib/ssmd/annotations/annotation.rb, line 21 def wrap(text) raise "wrap given text in resulting SSML element" end