Skip to content

Commit

Permalink
add comments for new API
Browse files Browse the repository at this point in the history
  • Loading branch information
leavez committed Nov 22, 2018
1 parent 327de86 commit 7b11f45
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/Mappable/Mapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ extension Mapper {

extension Mapper {

/// With the help of @dynamicMemberLookup, mapper API could be simplified:
///
/// // old
/// time = try map.from("time")
/// // new
/// time = try map.time()
///
public subscript<T>(dynamicMember member: String) -> () throws -> T {
return { try self.from(member) }
}
Expand Down

0 comments on commit 7b11f45

Please sign in to comment.