Skip to content

Commit

Permalink
Implemented SipElement
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Styles committed Mar 18, 2014
1 parent 8e43762 commit eff9cda
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions INDObjCTwiMLWriter/models/INDTwiMLSipElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@

@interface INDTwiMLSipElement : INDTwiMLElementWithValue

@property (nonatomic) NSString* username;
@property (nonatomic) NSString* password;
@end
16 changes: 16 additions & 0 deletions INDObjCTwiMLWriter/models/INDTwiMLSipElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

static NSString* const kTagName = @"Sip";

static NSString* const kUsernameKey = @"username";
static NSString* const kPasswordKey = @"password";

@implementation INDTwiMLSipElement

- (instancetype)init
Expand All @@ -21,4 +24,17 @@ - (instancetype)init
return self;
}

- (NSDictionary*)attributes
{
NSMutableDictionary* dict = [NSMutableDictionary new];
if (_username) {
dict[kUsernameKey] = _username;
}
if (_password) {
dict[kPasswordKey] = _password;
}

return [dict copy];
}

@end

0 comments on commit eff9cda

Please sign in to comment.