Sha256: eb2893501fdf5035e2470b7ee7700e568f47b76c005b680e6c51e20c2468d8f2

Contents?: true

Size: 658 Bytes

Versions: 40

Compression:

Stored size: 658 Bytes

Contents

module Test
  module Ox
    class Shape
      include HasProps

      attr_accessor :bounds
      attr_accessor :color
      attr_accessor :border, :border_color

      def initialize(left, top, wide, high, color=nil)
        @bounds = [[left, top], [left + wide, top + high]]
        @color = color
        @border = 1
        @border_color = :black
      end
      
      def left
        @bounds[0][0]
      end
      
      def top
        @bounds[0][1]
      end
      
      def width
        @bounds[1][0] - @bounds[0][0]
      end
      
      def height
        @bounds[1][1] - @bounds[0][1]
      end
      
    end # Shape
  end # Ox
end # Test

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
ox-1.5.4 test/ox/shape.rb
ox-1.5.3 test/ox/shape.rb
ox-1.5.2 test/ox/shape.rb
ox-1.5.1 test/ox/shape.rb
ox-1.5.0 test/ox/shape.rb
ox-1.4.6 test/ox/shape.rb
ox-1.4.5 test/ox/shape.rb
ox-1.4.4 test/ox/shape.rb
ox-1.4.3 test/ox/shape.rb
ox-1.4.2 test/ox/shape.rb
ox-1.4.1 test/ox/shape.rb
ox-1.4.0 test/ox/shape.rb
ox-1.3.5 test/ox/shape.rb
ox-1.3.4 test/ox/shape.rb
ox-1.3.3 test/ox/shape.rb
ox-1.3.2 test/ox/shape.rb
ox-1.3.1 test/ox/shape.rb
ox-1.3.0 test/ox/shape.rb
ox-1.2.15 test/ox/shape.rb
ox-1.2.14 test/ox/shape.rb