Class: Aozora2Html::Tag::Midashi
- Inherits:
-
ReferenceMentioned
- Object
- Aozora2Html::Tag
- Inline
- ReferenceMentioned
- Aozora2Html::Tag::Midashi
- Defined in:
- lib/aozora2html/tag/midashi.rb
Overview
見出し用
Instance Attribute Summary
Attributes inherited from ReferenceMentioned
Instance Method Summary collapse
-
#initialize(parser, target, size, type) ⇒ Midashi
constructor
A new instance of Midashi.
- #to_s ⇒ Object
Methods inherited from ReferenceMentioned
#block_element?, #target_string
Methods inherited from Aozora2Html::Tag
#char_type, #inspect, #syntax_error
Constructor Details
#initialize(parser, target, size, type) ⇒ Midashi
Returns a new instance of Midashi.
7 8 9 10 11 12 13 |
# File 'lib/aozora2html/tag/midashi.rb', line 7 def initialize(parser, target, size, type) super @target = target @tag = Utils.create_midashi_tag(size) @id = parser.new_midashi_id(size) @class = Utils.create_midashi_class(type, @tag) end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/aozora2html/tag/midashi.rb', line 15 def to_s "<#{@tag} class=\"#{@class}\"><a class=\"midashi_anchor\" id=\"midashi#{@id}\">#{@target}</a></#{@tag}>" end |