Sha256: 1d724eebc7e6d88812a87d82b16d9ea367bdf67c51056a57bd7118cb0cbcffda

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

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

#import <Foundation/NSDictionary.h>
#import "<%= @name %>.h"

@interface <%= @name %> ()

<% @keys.each do |key, value| %>@property (nonatomic, copy) NSString *<%= key %>;
<% end %>

@end

@implementation <%= @name %>

- (instancetype)init
{
    if (!(self = [super init])) { return nil; }

    <% @keys.each do |key, value| %>
    <% if @indexed_keys[key].length > 0 %>
      char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' };
    <% else %>
      char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { '\0' };
    <% end %>
    _<%= key %> = <% if @indexed_keys.length > 0 %>
        <% if @indexed_keys[key].length > 0 %>
          [NSString stringWithCString:<%= key %>CString encoding:NSUTF8StringEncoding];
        <% else %>
          @"";
        <% end %>
      <% else %>
        @"";
      <% end %>
    <% end %>

    return self;
}

static NSString *<%= name %>Data = @"<%= @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

3 entries across 3 versions & 1 rubygems

Version Path
cocoapods-keys-2.3.1 templates/Keys.m.erb
cocoapods-keys-2.3.0 templates/Keys.m.erb
cocoapods-keys-2.2.1 templates/Keys.m.erb