class Goo::CanvasPoints - goocanvas-1.2.6 Documentation

# class Goo::CanvasPoints

### Public Class Methods

new(arg) click to toggle source

    # File lib/goocanvas.rb, line 116
    def initialize(arg)
      if arg.respond_to?(:to_ary)
        points = arg.flatten
        num_points = points.length / 2
        _initialize(num_points)
        num_points.times { |i| self[i] = [ points[i*2], points[i*2+1] ] }
      else
        _initialize(arg)
      end
    end

Also aliased as: _initialize

### Public Instance Methods

_initialize(arg)
Alias for: new
each() { |self| ... } click to toggle source

    # File lib/goocanvas.rb, line 127
    def each
      num_points.times { |i| yield self[i] }
    end

to_a() click to toggle source

    # File lib/goocanvas.rb, line 131
    def to_a
      a = []
      each { |e| a.push(e) }
      a
    end