Class Joyau::Buffer
In: ruby/site_ruby/joyau/enumerable.rb
Parent: Object

Methods

Included Modules

Enumerable

Public Instance methods

[Source]

# File ruby/site_ruby/joyau/enumerable.rb, line 19
    def each
      (0...w).each do |x|
        (0...h).each do |y|
          yield self[x, y].to_col
        end
      end
    end

Iterates through a Buffer, yielding a point’s position, and its color.

 buffer.each_with_pos { |x, y, col| ... }

[Source]

# File ruby/site_ruby/joyau/enumerable.rb, line 29
    def each_with_pos
      (0...w).each do |x|
        (0...h).each do |y|
          yield x, y, self[x, y].to_col
        end
      end
    end

[Validate]