Class: Aozora2Html::Tag::Img

Inherits:
Inline show all
Defined in:
lib/aozora2html/tag/img.rb

Overview

画像用

Instance Method Summary collapse

Methods inherited from Aozora2Html::Tag

#char_type, #inspect, #syntax_error

Constructor Details

#initialize(parser, filename, css_class, alt, width, height) ⇒ Img

Returns a new instance of Img.



7
8
9
10
11
12
13
14
# File 'lib/aozora2html/tag/img.rb', line 7

def initialize(parser, filename, css_class, alt, width, height)
  @filename = filename
  @css_class = css_class
  @alt = alt
  @width = width
  @height = height
  super
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/aozora2html/tag/img.rb', line 16

def to_s
  "<img class=\"#{@css_class}\" width=\"#{@width}\" height=\"#{@height}\" src=\"#{@filename}\" alt=\"#{@alt}\" />"
end