##Intro This is a project for personal development to learn more about Objective-C and Ruby.
##Tests Tests are provided through Expecta, and are largely reproduced from the Ruby Reference page, some methods may be changed slightly in how they function, but for the most part the goal is to ape Ruby behaviour.
##Examples
####Loop five times
[@5 rby_times:^(NSInteger idx) {
NSLog(@"%d", idx);
}];
result
1
2
3
4
5
####Group by
NSArray *array = @[ @1, @2, @3, @4, @5, @6 ];
NSDictionary *result = [array rby_groupBy:^(NSNumber *object) {
return @([object integerValue] % 3);
}];
result
@{
@0 : @[ @3, @6 ],
@1 : @[ @1, @4 ],
@2 : @[ @2, @5 ],
}
##Current Implemented Methods
###NSArray+Ruby
#map
#group_by
#inject
#min
#max
#min_by
#max_by
#none
#one
#partition
#reject
#plus
#times
#union
#intersect
#compact
#cycle
#transpose
#unique
#rotate
#push
#pop
###NSNumber+Ruby
#abs
#ceil
#floor
#imaginary
#times
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Unit tests for NSArray which need writing:
#one
#partition
#reject
#plus
#plus
#times
#union
#intersect
#compact
#cycle
#transpose
#unique
#rotate
#push
#pop