Sha256: 80a71f8c0f269294e4c08f71f1c8774ece626436679a9780665c8ba2a84e250f

Contents?: true

Size: 445 Bytes

Versions: 3

Compression:

Stored size: 445 Bytes

Contents

# frozen_string_literal: true

require_relative './tag'

module Polites
  # A simple tag is a {Tag} defined by a single pattern, such as for headings.
  class SimpleTag < Tag
    # @return [String]
    attr_reader :pattern

    # @param [String] name
    # @param [String] pattern
    def initialize(name, pattern)
      super(name)
      @pattern = pattern
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polites-0.3.0 lib/polites/simple_tag.rb
polites-0.2.0 lib/polites/simple_tag.rb
polites-0.1.0 lib/polites/simple_tag.rb