class Typograf
Constants
- DEFAULT_GENERATE_OPTIONS
Public Class Methods
new(options={})
click to toggle source
# File lib/rus_typograf.rb, line 15 def initialize(options={}) @options = DEFAULT_GENERATE_OPTIONS.merge(options) end
Public Instance Methods
typograf_text(text)
click to toggle source
# File lib/rus_typograf.rb, line 19 def typograf_text(text) @text = text if @options[:punctuation_mark] punctuation = PunctuationMark.new @text = punctuation.replace_dots(@text) @text = punctuation.replace_spaces(@text) @text = punctuation.add_comma(@text) end if @options[:dash] dash = Dash.new @text = dash.replace_dash(@text) end if @options[:quotes] quotes = Quotes.new @text = quotes.replace_quote(@text) end end