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.2.13 test/ox/shape.rb
ox-1.2.12 test/ox/shape.rb
ox-1.2.11 test/ox/shape.rb
ox-1.2.10 test/ox/shape.rb
ox-1.2.9 test/ox/shape.rb
ox-1.2.8 test/ox/shape.rb
ox-1.2.7 test/ox/shape.rb
ox-1.2.6 test/ox/shape.rb
ox-1.2.5 test/ox/shape.rb
ox-1.2.4 test/ox/shape.rb
ox-1.2.3 test/ox/shape.rb
ox-1.2.2 test/ox/shape.rb
ox-1.2.1 test/ox/shape.rb
ox-1.2.0 test/ox/shape.rb
ox-1.1.1 test/ox/shape.rb
ox-1.1.0 test/ox/shape.rb
ox-1.0.3 test/ox/shape.rb
ox-1.0.2 test/ox/shape.rb
ox-1.0.1 test/ox/shape.rb
ox-1.0.0 test/ox/shape.rb