File: region.rb

package info (click to toggle)
ruby-cairo 1.16.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,468 kB
  • sloc: ruby: 11,856; ansic: 9,835; sh: 36; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 253 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Cairo
  class Region
    def each_rectangle
      return to_enum(:each_rectangle) unless block_given?
      num_rectangles.times.each do |i|
        yield(self[i])
      end
    end

    def rectangles
      each_rectangle.to_a
    end
  end
end