Class: Polites::RangeTag

Inherits:
Tag
  • Object
show all
Defined in:
lib/polites/range_tag.rb

Overview

A range tag is a Tag defined by a start and an end pattern, such as used by defining bold formatting.

Instance Attribute Summary collapse

Attributes inherited from Tag

#name

Instance Method Summary collapse

Constructor Details

#initialize(name, start_pattern, end_pattern) ⇒ RangeTag

Returns a new instance of RangeTag.

Parameters:

  • name (String)
  • start_pattern (String)
  • end_pattern (String)


17
18
19
20
21
# File 'lib/polites/range_tag.rb', line 17

def initialize(name, start_pattern, end_pattern)
  super(name)
  @start_pattern = start_pattern
  @end_pattern = end_pattern
end

Instance Attribute Details

#end_patternString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/polites/range_tag.rb', line 12

def end_pattern
  @end_pattern
end

#start_patternString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/polites/range_tag.rb', line 10

def start_pattern
  @start_pattern
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'lib/polites/range_tag.rb', line 23

def eql?(other)
  super &&
    start_pattern == other.start_pattern &&
    end_pattern == other.end_pattern
end