Class: Polites::SimpleTag

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

Overview

A simple tag is a Tag defined by a single pattern, such as for headings.

Instance Attribute Summary collapse

Attributes inherited from Tag

#name

Instance Method Summary collapse

Constructor Details

#initialize(name, pattern) ⇒ SimpleTag

Returns a new instance of SimpleTag.

Parameters:

  • name (String)
  • pattern (String)


13
14
15
16
# File 'lib/polites/simple_tag.rb', line 13

def initialize(name, pattern)
  super(name)
  @pattern = pattern
end

Instance Attribute Details

#patternString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/polites/simple_tag.rb', line 9

def pattern
  @pattern
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/polites/simple_tag.rb', line 18

def eql?(other)
  super && pattern == other.pattern
end