Module: NSIndexPathWrap

Defined in:
motion/core/ns_index_path.rb

Instance Method Summary collapse

Instance Method Details

#[](position) ⇒ Integer

Gives access to an index at a given position.

Raises:

  • (ArgumentError)


6
7
8
9
# File 'motion/core/ns_index_path.rb', line 6

def [](position)
  raise ArgumentError unless position.is_a?(Integer)
  indexAtPosition(position)
end

#eachNSIndexPath

Provides an iterator taking a block following the common Ruby idiom.



14
15
16
17
18
19
20
21
# File 'motion/core/ns_index_path.rb', line 14

def each
  i = 0
  until i == self.length
    yield self.indexAtPosition(i)
    i += 1
  end
  self
end