Sha256: 633bc655604d114ff06dca87e2d02d32feff29f08cc510fd7719f8760865de0f

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

# encoding: utf-8

require 'i18n'
require_relative '../typogrowth'

class String
  # Typographyes the string and returns a result
  # See Typogrowth::Parser#parse
  def typo lang = nil
    Typogrowth.parse(self, lang: lang ? lang : is_ru? ? "ru" : I18n.locale)
  end
  # Typographyes the string inplace
  # See Typogrowth::Parser#parse!
  def typo! lang = nil
    Typogrowth.parse!(self, lang: lang ? lang : is_ru? ? "ru" : I18n.locale)
  end

  def is_ru? shadows = []
    Typogrowth.is_ru? self, shadows: shadows
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typogrowth-0.9.7 lib/typogrowth/string.rb