Sha256: cbf415f244127f506b6ea0f7d015e18b190b8fd55eb32c765c19d9b47c7caf78

Contents?: true

Size: 561 Bytes

Versions: 4

Compression:

Stored size: 561 Bytes

Contents

class NSIndexPath

  # Gives access to an index at a given position.
  # @param [Integer] position to use to fetch the index
  # @return [Integer] the index for the given position
  def [](position)
    raise ArgumentError unless position.is_a?(Integer)
    indexAtPosition(position)
  end

  # Provides an iterator taking a block following the common Ruby idiom.
  # @param [Block]
  # @return [NSIndexPath] the iterated object itself
  def each
    i = 0
    until i == self.length
      yield self.indexAtPosition(i)
      i += 1
    end
    self
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bubble-wrap-0.2.0 lib/bubble-wrap/ns_index_path.rb
bubble-wrap-0.1.2 lib/bubble-wrap/ns_index_path.rb
bubble-wrap-0.1.1 lib/bubble-wrap/ns_index_path.rb
bubble-wrap-0.1.0 lib/bubble-wrap/ns_index_path.rb