Sha256: 685b61f997ac0419f1c2f757d833b9f80f45ad673ecda4d27781032cd471150f

Contents?: true

Size: 581 Bytes

Versions: 273

Compression:

Stored size: 581 Bytes

Contents

module Sample
  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 # Sample

Version data entries

273 entries across 273 versions & 4 rubygems

Version Path
oj-3.9.2 test/sample/shape.rb
oj-3.9.1 test/sample/shape.rb
oj-3.9.0 test/sample/shape.rb
oj-3.8.1 test/sample/shape.rb
oj-3.8.0 test/sample/shape.rb
oj-3.7.12 test/sample/shape.rb
oj-3.7.11 test/sample/shape.rb
oj-3.7.10 test/sample/shape.rb
oj-3.7.9 test/sample/shape.rb
oj-3.7.8 test/sample/shape.rb
oj-3.7.7 test/sample/shape.rb
oj-3.7.6 test/sample/shape.rb
oj-3.7.5 test/sample/shape.rb
oj-3.7.4 test/sample/shape.rb
oj-3.7.3 test/sample/shape.rb
oj-3.7.2 test/sample/shape.rb
oj-3.7.1 test/sample/shape.rb
oj-3.7.0 test/sample/shape.rb
oj-3.6.13 test/sample/shape.rb
oj-3.6.12 test/sample/shape.rb