Class: Polites::Tag

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

Overview

A tag is used to define the markup used in Polites documents.

Direct Known Subclasses

RangeTag, SimpleTag

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Tag

Returns a new instance of Tag.

Parameters:

  • name (String)


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

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameString (readonly)

Returns:

  • (String)


7
8
9
# File 'lib/polites/tag.rb', line 7

def name
  @name
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


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

def eql?(other)
  other.is_a?(self.class) && name == other.name
end