Sha256: 3d5ebb06ddcb687e35cf5ba4c1ea79b03285cb76896f4feefd23986736861f34

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

module Vedeu

  # Represents an invisible escape character sequence.
  #
  # @api private
  class EscapeChar

    # @!attribute [r] value
    # @return [String]
    attr_reader :value
    alias_method :to_s, :value
    alias_method :to_str, :value

    # Returns a new instance of Vedeu::EscapeChar.
    #
    # @param value [String]
    # @return [Vedeu::EscapeChar]
    def initialize(value)
      @value = value
    end

    # @return [String]
    def colour
      ''
    end

    # An object is equal when its values are the same.
    #
    # @param other [Vedeu::Char]
    # @return [Boolean]
    def eql?(other)
      self.class == other.class && value == other.value
    end
    alias_method :==, :eql?

    # Override Ruby's Object#inspect method to provide a more helpful output.
    #
    # @return [String]
    def inspect
      "<Vedeu::EscapeChar '#{Vedeu::Esc.escape(to_s)}'>"
    end

    # @return [String]
    def position
      ''
    end

    # @return [String]
    def style
      ''
    end

  end # EscapeChar

end # Vedeu

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vedeu-0.4.55 lib/vedeu/models/escape_char.rb
vedeu-0.4.54 lib/vedeu/models/escape_char.rb
vedeu-0.4.53 lib/vedeu/models/escape_char.rb
vedeu-0.4.52 lib/vedeu/models/escape_char.rb
vedeu-0.4.51 lib/vedeu/models/escape_char.rb
vedeu-0.4.50 lib/vedeu/models/escape_char.rb
vedeu-0.4.49 lib/vedeu/models/escape_char.rb
vedeu-0.4.48 lib/vedeu/models/escape_char.rb
vedeu-0.4.47 lib/vedeu/models/escape_char.rb
vedeu-0.4.46 lib/vedeu/models/escape_char.rb
vedeu-0.4.45 lib/vedeu/models/escape_char.rb