Skip to content

Instantly share code, notes, and snippets.

@lassebunk
Last active January 3, 2016 04:39
Show Gist options
  • Save lassebunk/8410259 to your computer and use it in GitHub Desktop.
Save lassebunk/8410259 to your computer and use it in GitHub Desktop.
Ruby vs. Objective-C
// Objective-C
- (NSMutableArray *)products {
if (_products == nil) {
_products = [[NSMutableArray alloc] init];
}
return _products;
}
# Ruby
def products
@products ||= []
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment