jeffh / Hydrant

A simple data mapper / object serializer for objective-c
BSD 3-Clause "New" or "Revised" License
18 stars 3 forks source link

Support multi-key merging #21

Closed jeffh closed 10 years ago

jeffh commented 10 years ago

Provide a declarative way to merge object keys into an object. e.g.

{
    "text": "First",
    "date": "2013-12-22",
    "time": "14:23:45"
}

And then do something like (magic code):

HYDMapObject(HYDRootMapper, [Post class],
    @{@"text": @"text",
      HYDAccessKey(@"date", @"time"): HYDMapStringToDateFormatter(HYDMapArrayToString(@"date", @"T"), HYDDateFormatRFC3339)}
);
jeffh commented 10 years ago

This is supported as of e79e5e01970e1f9b131dd044570883286a467cf4, although there's not much assistance in Hydrant after an accessor emits an array right now.