Sha256: fa7380e6bd061b29441256c3892ada7c32a0157c399af0e0761863889a086f47

Contents?: true

Size: 510 Bytes

Versions: 3

Compression:

Stored size: 510 Bytes

Contents

module WhirledPeas
  module UI
    class Stroke
      EMPTY = Stroke.new

      attr_reader :left, :top, :chars

      def initialize(left, top, chars)
        @left = left
        @top = top
        @chars = chars
      end

      def hash
        [left, top, chars].hash
      end

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

      def inspect
        "Stroke(left=#{left}, top=#{top}, chars=#{chars})"
      end

      alias_method :eql?, :==
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
whirled_peas-0.2.0 lib/whirled_peas/ui/stroke.rb
whirled_peas-0.1.1 lib/whirled_peas/ui/stroke.rb
whirled_peas-0.1.0 lib/whirled_peas/ui/stroke.rb