class Aozora2Html::Tag::Accent
欧文アクセント文字用
Attributes
use_jisx0213[RW]
Public Class Methods
new(parser, code, name, gaiji_dir:)
click to toggle source
Calls superclass method
Aozora2Html::Tag::Inline::new
# File lib/aozora2html/tag/accent.rb, line 13 def initialize(parser, code, name, gaiji_dir:) @code = code @name = name @gaiji_dir = gaiji_dir super end
Public Instance Methods
char_type()
click to toggle source
# File lib/aozora2html/tag/accent.rb, line 24 def char_type :hankaku end
jisx0213_to_unicode(code)
click to toggle source
# File lib/aozora2html/tag/accent.rb, line 20 def jisx0213_to_unicode(code) Aozora2Html::JIS2UCS[code] end
to_s()
click to toggle source
# File lib/aozora2html/tag/accent.rb, line 28 def to_s if Aozora2Html::Tag::Accent.use_jisx0213 jisx0213_to_unicode(@code.sub(%r{.*/}, '').to_sym) else "<img src=\"#{@gaiji_dir}#{@code}.png\" alt=\"" + GAIJI_MARK + "(#{@name})\" class=\"gaiji\" />" end end