Sha256: 904acc32aacdcac8c32b22171b5f149c160a253bbe4c84e4488ea57976c1f4b4

Contents?: true

Size: 510 Bytes

Versions: 9

Compression:

Stored size: 510 Bytes

Contents

module Semlogr
  module Templates
    class TextToken
      attr_accessor :text

      def initialize(text)
        @text = text
      end

      def render(output, _properties)
        output << @text
      end

      def ==(other)
        return false unless other
        return false unless other.respond_to?(:text)

        @text == other.text
      end

      def eql?(other)
        self == other
      end

      def hash
        @text.hash
      end

      EMPTY = TextToken.new('')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
semlogr-0.3.0 lib/semlogr/templates/text_token.rb
semlogr-0.2.3 lib/semlogr/templates/text_token.rb
semlogr-0.2.2 lib/semlogr/templates/text_token.rb
semlogr-0.2.1 lib/semlogr/templates/text_token.rb
semlogr-0.2.0 lib/semlogr/templates/text_token.rb
semlogr-0.1.3 lib/semlogr/templates/text_token.rb
semlogr-0.1.2 lib/semlogr/templates/text_token.rb
semlogr-0.1.1 lib/semlogr/templates/text_token.rb
semlogr-0.1.0 lib/semlogr/templates/text_token.rb