Class Kwartz::TagInfo
In: kwartz/converter.rb
Parent: Object

Methods

External Aliases

is_etag -> is_etag?
is_empty -> is_empty?

Attributes

attr_str  [RW] 
extra_space  [RW] 
head_space  [RW] 
is_empty  [RW] 
is_etag  [RW] 
linenum  [RW] 
prev_text  [RW] 
tag_text  [RW] 
tagname  [RW] 
tail_space  [RW] 

Public Class methods

[Source]

# File kwartz/converter.rb, line 46
    def initialize(matched, linenum=nil)
      @prev_text   = matched[1]
      @tag_text    = matched[2]
      @head_space  = matched[3]
      @is_etag     = matched[4] == '/'
      @tagname     = matched[5]
      @attr_str    = matched[6]
      @extra_space = matched[7]
      @is_empty    = matched[8] == '/'
      @tail_space  = matched[9]
      @linenum = linenum
    end

Public Instance methods

[Source]

# File kwartz/converter.rb, line 85
    def _inspect
      return [ @prev_text, @head_space, @is_etag, @tagname, @attr_str, @extra_space, @is_empty, @tail_space ]
    end

[Source]

# File kwartz/converter.rb, line 73
    def rebuild_tag_text(attr_info=nil)
      if attr_info
        sb = ''
        attr_info.each do |space, aname, avalue|
          sb << "#{space}#{aname}=\"#{avalue}\""
        end
        @attr_str = sb
      end
      @tag_text = "#{@head_space}<#{@is_etag ? '/' : ''}#{@tagname}#{@attr_str}#{@extra_space}#{@is_empty ? '/' : ''}>#{@tail_space}"
    end

[Source]

# File kwartz/converter.rb, line 66
    def tagname=(tagname)
      @tagname = tagname
      rebuild_tag_text()
      tagname
    end

[Validate]