Class: Tag
- Inherits:
-
Object
- Object
- Tag
- Defined in:
- lib/doc/model/common/tag.rb
Instance Method Summary collapse
-
#initialize(name, content, attr) ⇒ Tag
constructor
A new instance of Tag.
- #to_s ⇒ Object
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_s ⇒ Object
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 |