Skip to content

Commit

Permalink
Renamed enum type ObjectionInstantiationRuleEverytime to ObjectionIns…
Browse files Browse the repository at this point in the history
…tantiationRuleNormal
  • Loading branch information
jdewind committed May 6, 2011
1 parent a59e159 commit 741be8d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/Objection.h
Expand Up @@ -14,7 +14,7 @@
#define objection_register(value) \
+ (void)initialize { \
if (self == [value class]) { \
[Objection registerClass:[value class] lifeCycle: ObjectionInstantiationRuleEverytime]; \
[Objection registerClass:[value class] lifeCycle: ObjectionInstantiationRuleNormal]; \
} \
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Objection.m
Expand Up @@ -44,7 +44,7 @@ + (void)initialize
+ (void) registerClass:(Class)theClass lifeCycle:(ObjectionInstantiationRule)lifeCycle
{
pthread_mutex_lock(&gObjectionMutex);
if (lifeCycle != ObjectionInstantiationRuleSingleton && lifeCycle != ObjectionInstantiationRuleEverytime) {
if (lifeCycle != ObjectionInstantiationRuleSingleton && lifeCycle != ObjectionInstantiationRuleNormal) {
@throw [NSException exceptionWithName:@"ObjectionInjectorException" reason:@"Invalid Instantiation Rule" userInfo:nil];
}

Expand Down
2 changes: 1 addition & 1 deletion Source/ObjectionEntry.h
Expand Up @@ -2,7 +2,7 @@

typedef enum {
ObjectionInstantiationRuleNone = -1,
ObjectionInstantiationRuleEverytime,
ObjectionInstantiationRuleNormal,
ObjectionInstantiationRuleSingleton
} ObjectionInstantiationRule;

Expand Down
4 changes: 2 additions & 2 deletions Source/ObjectionInjectorEntry.m
Expand Up @@ -28,7 +28,7 @@ - (id)initWithClass:(Class)theClass lifeCycle:(ObjectionInstantiationRule)theLif

- (id)extractObject
{
if (self.lifeCycle == ObjectionInstantiationRuleEverytime) {
if (self.lifeCycle == ObjectionInstantiationRuleNormal) {
return [self buildObject];
} else if (!_storageCache) {
_storageCache = [[self buildObject] retain];
Expand Down Expand Up @@ -75,7 +75,7 @@ - (id)buildObject
id theObject = [self.injector getObject:desiredClassOrProtocol];

if(theObject == nil && propertyInfo.type == ObjectionTypeClass) {
[Objection registerClass:desiredClassOrProtocol lifeCycle: ObjectionInstantiationRuleEverytime];
[Objection registerClass:desiredClassOrProtocol lifeCycle: ObjectionInstantiationRuleNormal];
theObject = [_injector getObject:desiredClassOrProtocol];
} else if (!theObject) {
@throw [NSException exceptionWithName:@"ObjectionException"
Expand Down

0 comments on commit 741be8d

Please sign in to comment.