Class: Img_tag

Inherits:
Aozora_tag show all
Includes:
Inline_tag
Defined in:
lib/t2hs.rb

Instance Method Summary collapse

Methods inherited from Aozora_tag

#inspect, #syntax_error

Constructor Details

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

Returns a new instance of Img_tag.



658
659
660
661
# File 'lib/t2hs.rb', line 658

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



662
663
664
# File 'lib/t2hs.rb', line 662

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