class Tag

A Tag wrapping an element in an HTML file. It contains information about the node wrapped inside it such as the start and end offset. The `tag` attr contains the actual HTML, and includes information used to style the nodes based on whether its an insertion, deletion or modification. Matching modifications are wrapped in anchor tags so they can be linked to their matches.

Attributes

idx[RW]
start[RW]
tag[RW]

Public Class Methods

new(tag, idx, start=-1) click to toggle source

Construct a new tag.

@param tag [String] An HTML tag. @param idx [Fixnum] for open tag: start offset. closing tag: end offset @param start [Fixnum] for open tag: -1. for closing tag: start offset.

@return [Tag] The Tag which was constructed.

# File lib/smart_diff/htmlize.rb, line 27
def initialize(tag, idx, start=-1)
  @tag = tag
  @idx = idx
  @start = start
end

Public Instance Methods

to_s() click to toggle source

String representation of the Tag object.

@return [String] Tag as string.

# File lib/smart_diff/htmlize.rb, line 38
def to_s
  "tag: #{@tag}, idx: #{@idx} start: #{@start}"
end