Skip to content

Commit

Permalink
Fix init in DBTransportBaseHostnameConfig (#383)
Browse files Browse the repository at this point in the history
* fix init in DBTransportBaseHostnameConfig

* fix downloadContent setting

* add comment to initializer
  • Loading branch information
jamesyangf authored May 17, 2024
1 parent de63d14 commit 2e44b6c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ NS_ASSUME_NONNULL_BEGIN
///
- (instancetype)init;

///
/// Constructor that takes in a set of custom hostnames to use for api calls.
///
/// @param meta the hostname to metaserver
/// @param api the hostname to api server
/// @param content the hostname to content server
/// @param notify the hostname to notify server
///
/// @return An initialized instance with the provided hostname configuration
///
- (instancetype)initWithMeta:(NSString *)meta api:(NSString *)api content:(NSString *)content notify:(NSString *)notify;

///
/// Constructor that takes in a set of custom hostnames to use for api calls.
///
Expand All @@ -51,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
///
/// @return An initialized instance with the provided hostname configuration
///
- (instancetype)initWithMeta:(NSString *)meta api:(NSString *)api content:(NSString *)content downloadContent:(NSString *)downloadContent notify:(NSString *)notify;
- (instancetype)initWithMeta:(NSString *)meta api:(NSString *)api content:(NSString *)content downloadContent:(NSString *)downloadContent notify:(NSString *)notify NS_DESIGNATED_INITIALIZER;

///
/// Returns the prefix to use for API calls to the given route type.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,21 @@ - (instancetype)initWithMeta:(NSString *)meta
api:(NSString *)api
content:(NSString *)content
notify:(NSString *)notify {
if (self = [super init]) {
_meta = meta;
_api = api;
_content = content;
_downloadContent = content;
_notify = notify;
}
return self;
return [self initWithMeta:meta api:api content:content downloadContent:content notify:notify];
}

- (instancetype)initWithMeta:(NSString *)meta
api:(NSString *)api
content:(NSString *)content
downloadContent:(NSString *)downloadContent
notify:(NSString *)notify {
self = [self initWithMeta:meta api:api content:content notify:notify];
_downloadContent = downloadContent;
if (self = [super init]) {
_meta = meta;
_api = api;
_content = content;
_downloadContent = downloadContent;
_notify = notify;
}
return self;
}

Expand Down

0 comments on commit 2e44b6c

Please sign in to comment.