Class: Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/doc/model/common/tag.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, content, attr) ⇒ Tag

Returns a new instance of Tag.



2
3
4
5
6
# File 'lib/doc/model/common/tag.rb', line 2

def initialize name, content, attr
  @tagName = tagName
  @content = content
  @attr = attr
end

Instance Method Details

#to_sObject



8
9
10
11
12
13
14
# File 'lib/doc/model/common/tag.rb', line 8

def to_s
  attrStr = ''
  @attr.each do |key, value|
    attrStr << " #{key}='#{value}'"
  end
  "<#{@tagName}#{attrStr}>#{@content}</#{@tagName}>"
end