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
devcycle-ruby-server-sdk-2.0.0 vendor/bundle/ruby/3.0.0/gems/oj-3.13.2/test/sample/shape.rb
oj-3.14.2 test/sample/shape.rb
oj-3.14.1 test/sample/shape.rb
oj-3.14.0 test/sample/shape.rb
oj-3.13.23 test/sample/shape.rb
oj-3.13.22 test/sample/shape.rb
oj-3.13.21 test/sample/shape.rb
oj-3.13.20 test/sample/shape.rb
oj-3.13.19 test/sample/shape.rb
oj-3.13.18 test/sample/shape.rb
oj-3.13.17 test/sample/shape.rb
oj-3.13.16 test/sample/shape.rb
oj-3.13.15 test/sample/shape.rb
oj-3.13.14 test/sample/shape.rb
oj-3.13.13 test/sample/shape.rb
oj-3.13.12 test/sample/shape.rb
oj-3.13.11 test/sample/shape.rb
oj-3.13.10 test/sample/shape.rb
oj-3.13.9 test/sample/shape.rb
oj-3.13.8 test/sample/shape.rb