Sha256: 97df23ea80949d86a9255130e597391f174723de9fa5793c5b9b049b1becf7cf

Contents?: true

Size: 1.63 KB

Versions: 12

Compression:

Stored size: 1.63 KB

Contents

//
// Generated by CocoaPods-Keys
// on <%= @time.strftime("%d/%m/%Y") %>
// For more information see https://github.com/orta/cocoapods-keys
//

#import <objc/runtime.h>
#import <Foundation/NSDictionary.h>
#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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cocoapods-keys-1.7.0 templates/Keys.m.erb
cocoapods-keys-1.6.1 templates/Keys.m.erb
cocoapods-keys-1.6.0 templates/Keys.m.erb
cocoapods-keys-1.5.2 templates/Keys.m.erb
cocoapods-keys-1.5.1 templates/Keys.m.erb
cocoapods-keys-1.5.0 templates/Keys.m.erb
cocoapods-keys-1.4.0 templates/Keys.m.erb
cocoapods-keys-1.3.2 templates/Keys.m.erb
cocoapods-keys-1.3.1 templates/Keys.m.erb
cocoapods-keys-1.3.0 templates/Keys.m.erb
cocoapods-keys-1.2.1 templates/Keys.m.erb
cocoapods-keys-1.2.0 templates/Keys.m.erb