Sha256: d9f8379c53411c65a94bfbbc056a483391a35b8332a87d816ae489049984523b

Contents?: true

Size: 543 Bytes

Versions: 4

Compression:

Stored size: 543 Bytes

Contents

module Ray
  module GL
    class IntArray
      include Enumerable

      def each
        (0...size).each { |i| yield self[i] }
      end

      # @yield A block changing each value of the array
      # @yieldparam [Integer] val Old value
      # @yieldreturn [Integer] New value
      def map!
        (0...size).each { |i| self[i] = yield self[i] }
      end

      # @yield Each index of the array
      # @yieldparam [Integer] i Index of an element
      def each_index(&block)
        (0...size).each(&block)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ray-0.2.1 lib/ray/gl/int_array.rb
ray-0.2.0 lib/ray/gl/int_array.rb
ray-0.1.1 lib/ray/gl/int_array.rb
ray-0.1.0 lib/ray/gl/int_array.rb