Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed name of class parameter to modelClass #499

Merged
merged 1 commit into from Apr 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Mantle/NSDictionary+MTLMappingAdditions.h
Expand Up @@ -16,6 +16,6 @@
///
/// Returns a dictionary that maps all properties of the given class to
/// themselves.
+ (NSDictionary *)mtl_identityPropertyMapWithModel:(Class)class;
+ (NSDictionary *)mtl_identityPropertyMapWithModel:(Class)modelClass;

@end
6 changes: 3 additions & 3 deletions Mantle/NSDictionary+MTLMappingAdditions.m
Expand Up @@ -12,10 +12,10 @@

@implementation NSDictionary (MTLMappingAdditions)

+ (NSDictionary *)mtl_identityPropertyMapWithModel:(Class)class {
NSCParameterAssert([class isSubclassOfClass:MTLModel.class]);
+ (NSDictionary *)mtl_identityPropertyMapWithModel:(Class)modelClass {
NSCParameterAssert([modelClass isSubclassOfClass:MTLModel.class]);

NSArray *propertyKeys = [class propertyKeys].allObjects;
NSArray *propertyKeys = [modelClass propertyKeys].allObjects;

return [NSDictionary dictionaryWithObjects:propertyKeys forKeys:propertyKeys];
}
Expand Down
Expand Up @@ -70,7 +70,7 @@ extern NSString * const MTLBooleanValueTransformerName;
///
/// Returns a transformer which will return an error if the transformed in value
/// is not a member of class. Otherwise, the value is simply passed through.
+ (NSValueTransformer<MTLTransformerErrorHandling> *)mtl_validatingTransformerForClass:(Class)class;
+ (NSValueTransformer<MTLTransformerErrorHandling> *)mtl_validatingTransformerForClass:(Class)modelClass;

+ (NSValueTransformer<MTLTransformerErrorHandling> *)mtl_JSONDictionaryTransformerWithModelClass:(Class)modelClass __attribute__((deprecated("Replaced by +[MTLJSONAdapter dictionaryTransformerWithModelClass:]")));

Expand Down
8 changes: 4 additions & 4 deletions Mantle/NSValueTransformer+MTLPredefinedTransformerAdditions.m
Expand Up @@ -228,15 +228,15 @@ + (void)load {
}
}

+ (NSValueTransformer<MTLTransformerErrorHandling> *)mtl_validatingTransformerForClass:(Class)class {
NSParameterAssert(class != nil);
+ (NSValueTransformer<MTLTransformerErrorHandling> *)mtl_validatingTransformerForClass:(Class)modelClass {
NSParameterAssert(modelClass != nil);

return [MTLValueTransformer transformerUsingForwardBlock:^ id (id value, BOOL *success, NSError **error) {
if (value != nil && ![value isKindOfClass:class]) {
if (value != nil && ![value isKindOfClass:modelClass]) {
if (error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: NSLocalizedString(@"Value did not match expected type", @""),
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedString(@"Expected %1$@ to be of class %2$@", @""), value, class],
NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedString(@"Expected %1$@ to be of class %2$@", @""), value, modelClass],
MTLTransformerErrorHandlingInputValueErrorKey : value
};

Expand Down