Class: Aozora2Html::Tag::Accent
- Inherits:
-
Inline
- Object
- Aozora2Html::Tag
- Inline
- Aozora2Html::Tag::Accent
- Defined in:
- lib/aozora2html/tag/accent.rb
Overview
欧文アクセント文字用
Class Attribute Summary collapse
-
.use_jisx0213 ⇒ Object
Returns the value of attribute use_jisx0213.
Instance Method Summary collapse
- #char_type ⇒ Object
-
#initialize(parser, code, name, gaiji_dir:) ⇒ Accent
constructor
A new instance of Accent.
- #jisx0213_to_unicode(code) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Aozora2Html::Tag
Constructor Details
#initialize(parser, code, name, gaiji_dir:) ⇒ Accent
Returns a new instance of Accent.
13 14 15 16 17 18 |
# 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 |
Class Attribute Details
.use_jisx0213 ⇒ Object
Returns the value of attribute use_jisx0213.
10 11 12 |
# File 'lib/aozora2html/tag/accent.rb', line 10 def use_jisx0213 @use_jisx0213 end |
Instance Method Details
#char_type ⇒ Object
24 25 26 |
# File 'lib/aozora2html/tag/accent.rb', line 24 def char_type :hankaku end |
#jisx0213_to_unicode(code) ⇒ Object
20 21 22 |
# File 'lib/aozora2html/tag/accent.rb', line 20 def jisx0213_to_unicode(code) Aozora2Html::JIS2UCS[code] end |
#to_s ⇒ Object
28 29 30 31 32 33 34 |
# 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 |