class SSMD::Processors::BreakProcessor
Public Instance Methods
attribute()
click to toggle source
# File lib/ssmd/processors/break_processor.rb, line 22 def attribute if ms = (match[:num] || match[:ms]) if ms == "0" ["strength", "none"] else ["time", "#{ms.to_i}ms"] end elsif s = match[:s] ["time", "#{s.to_i}s"] elsif match[:paragraph] ["strength", "x-strong"] elsif match[:sentence] ["strength", "strong"] elsif match[:comma] ["strength", "medium"] else ["strength", "x-strong"] end end
regex()
click to toggle source
# File lib/ssmd/processors/break_processor.rb, line 18 def regex /(?<=\s|\A)\.\.\.(?:(?<comma>c)|(?<sentence>s)|(?<paragraph>p)|(?<s>\d+s)|(?<ms>\d+ms)|(?<num>\d+))?(?=\s|\z)/ end
result()
click to toggle source
# File lib/ssmd/processors/break_processor.rb, line 8 def result name, value = attribute "<break #{name}=\"#{value}\"/>" end
text()
click to toggle source
# File lib/ssmd/processors/break_processor.rb, line 14 def text "" end