Skip to content

Commit

Permalink
Renamed createInstance to provider on JSObjectionProvider interface i…
Browse files Browse the repository at this point in the history
…n order to better define the intentions of the API
  • Loading branch information
jdewind committed Feb 29, 2012
1 parent 32ca812 commit fb1c143
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Rakefile
Expand Up @@ -64,6 +64,9 @@ task :build_all do
end

namespace :specs do
desc "All Specs"
task :all => [:osx, :ios]

desc "OS X Specs"
task :osx do
stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_specs.output") if (ENV['IS_CI_BOX'])
Expand Down
2 changes: 1 addition & 1 deletion Source/JSObjectionModule.h
Expand Up @@ -3,7 +3,7 @@
@class JSObjectionInjector;

@protocol JSObjectionProvider<NSObject>
- (id)createInstance:(JSObjectionInjector *)context;
- (id)provide:(JSObjectionInjector *)context;
@end


Expand Down
2 changes: 1 addition & 1 deletion Source/JSObjectionModule.m
Expand Up @@ -21,7 +21,7 @@ - (id)initWithClass:(Class)aClass
return self;
}

- (id)createInstance:(JSObjectionInjector *)context
- (id)provide:(JSObjectionInjector *)context
{
return [context getObject:_class];
}
Expand Down
2 changes: 1 addition & 1 deletion Source/JSObjectionProviderEntry.m
Expand Up @@ -26,7 +26,7 @@ - (id)extractObject
if (_block) {
return _block(self.injector);
}
return [_provider createInstance:self.injector];
return [_provider provide:self.injector];
}

- (void)dealloc
Expand Down
4 changes: 2 additions & 2 deletions Specs/ModuleFixtures.m
Expand Up @@ -72,7 +72,7 @@ - (void)dealloc {
@end

@implementation CarProvider
- (id)createInstance:(JSObjectionInjector *)context
- (id)provide:(JSObjectionInjector *)context
{
Car *car = [context getObject:[ManualCar class]];
car.engine = (id)@"my engine";
Expand All @@ -81,7 +81,7 @@ - (id)createInstance:(JSObjectionInjector *)context
@end

@implementation GearBoxProvider
- (id)createInstance:(JSObjectionInjector *)context
- (id)provide:(JSObjectionInjector *)context
{
return [[[AfterMarketGearBox alloc] init] autorelease];
}
Expand Down

0 comments on commit fb1c143

Please sign in to comment.