Sha256: afa47029bc1ca87f1c09d98c35e48d2488f8b1bb0041a4f4c553a7ee6e343c39

Contents?: true

Size: 216 Bytes

Versions: 4

Compression:

Stored size: 216 Bytes

Contents

module Geometer
  class Rectangle < Struct.new(:origin, :dimensions)
    def contains?(position)
      dimensions.contains?(position.translate(-origin)) 
    end

    def area
      dimensions.area
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
geometer-0.1.3 lib/geometer/rectangle.rb
geometer-0.1.2 lib/geometer/rectangle.rb
geometer-0.1.1 lib/geometer/rectangle.rb
geometer-0.1.0 lib/geometer/rectangle.rb