Module: NSIndexPathWrap
- Defined in:
- motion/core/ns_index_path.rb,
motion/core/ios/ns_index_path.rb
Instance Method Summary collapse
- #+(aNumber) ⇒ Object
- #-(aNumber) ⇒ Object
-
#[](position) ⇒ Integer
Gives access to an index at a given position.
-
#each ⇒ NSIndexPath
Provides an iterator taking a block following the common Ruby idiom.
Instance Method Details
#+(aNumber) ⇒ Object
3 4 5 |
# File 'motion/core/ios/ns_index_path.rb', line 3 def +(aNumber) self.class.indexPathForRow(row+aNumber, inSection:section) end |
#-(aNumber) ⇒ Object
7 8 9 |
# File 'motion/core/ios/ns_index_path.rb', line 7 def -(aNumber) self.class.indexPathForRow(row-aNumber, inSection:section) end |
#[](position) ⇒ Integer
Gives access to an index at a given position.
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 |
#each ⇒ NSIndexPath
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 |