Class: Tag
- Inherits:
-
Object
- Object
- Tag
- Defined in:
- lib/smart_diff/htmlize.rb
Overview
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.
Instance Attribute Summary (collapse)
-
- (Object) idx
Returns the value of attribute idx.
-
- (Object) start
Returns the value of attribute start.
-
- (Object) tag
Returns the value of attribute tag.
Instance Method Summary (collapse)
-
- (Tag) initialize(tag, idx, start = -1))
constructor
Construct a new tag.
-
- (String) to_s
String representation of the Tag object.
Constructor Details
- (Tag) initialize(tag, idx, start = -1))
Construct a new tag.
27 28 29 30 31 |
# File 'lib/smart_diff/htmlize.rb', line 27 def initialize(tag, idx, start=-1) @tag = tag @idx = idx @start = start end |
Instance Attribute Details
- (Object) idx
Returns the value of attribute idx
16 17 18 |
# File 'lib/smart_diff/htmlize.rb', line 16 def idx @idx end |
- (Object) start
Returns the value of attribute start
16 17 18 |
# File 'lib/smart_diff/htmlize.rb', line 16 def start @start end |
- (Object) tag
Returns the value of attribute tag
16 17 18 |
# File 'lib/smart_diff/htmlize.rb', line 16 def tag @tag end |
Instance Method Details
- (String) to_s
String representation of the Tag object.
38 39 40 |
# File 'lib/smart_diff/htmlize.rb', line 38 def to_s "tag: #{@tag}, idx: #{@idx} start: #{@start}" end |