// // Generated by CocoaPods-Keys // on <%= @time.strftime("%d/%m/%Y") %> // For more information see https://github.com/orta/cocoapods-keys // #import #import #import "<%= @name %>.h" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wincomplete-implementation" @implementation <%= @name %> #pragma clang diagnostic pop + (BOOL)resolveInstanceMethod:(SEL)name { NSString *key = NSStringFromSelector(name); NSString * (*implementation)(<%= name %> *, SEL) = NULL; <% @keys.each do |key, value| %> if ([key isEqualToString:@"<%= key %>"]) { implementation = _podKeys<%= Digest::MD5.hexdigest(key) %>; } <% end %> if (!implementation) { return [super resolveInstanceMethod:name]; } return class_addMethod([self class], name, (IMP)implementation, "@@:"); } <% @keys.each do |key, value| %> static NSString *_podKeys<%= Digest::MD5.hexdigest(key) %>(<%= name %> *self, SEL _cmd) { <% if @indexed_keys.length > 0 %> <% if @indexed_keys[key].length > 0 %> char cString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' }; <% else %> char cString[1] = { '\0' }; <% end %> return [NSString stringWithCString:cString encoding:NSUTF8StringEncoding]; <% else %> return @""; <% end %> } <% end %> static char <%= name %>Data[<%= @data_length %>] = "<%= @data.gsub('\\', '\\\\\\').gsub('"', '\\"') if @data %>"; - (NSString *)description { return [@{ <%- @keys.each do |key, value| -%> @"<%= key %>": self.<%= key %>, <%- end -%> } description]; } - (id)debugQuickLookObject { return [self description]; } @end