module Aozora2Html::StringRefinements

String extension

Public Instance Methods

char_type() click to toggle source

used in RubyBuffer#char_type

# File lib/aozora2html/string_refinements.rb, line 8
def char_type
  case self
  when Aozora2Html::REGEX_HIRAGANA
    :hiragana
  when Aozora2Html::REGEX_KATAKANA
    :katakana
  when Aozora2Html::REGEX_ZENKAKU
    :zenkaku
  when Aozora2Html::REGEX_HANKAKU
    :hankaku
  when Aozora2Html::REGEX_KANJI
    :kanji
  when /[.;"?!)]/
    :hankaku_terminate
  else
    :else
  end
end
to_sjis() click to toggle source
# File lib/aozora2html/string_refinements.rb, line 27
def to_sjis
  encode(Encoding::Shift_JIS)
end
to_utf8() click to toggle source
# File lib/aozora2html/string_refinements.rb, line 31
def to_utf8
  encode(Encoding::UTF_8)
end