-
Notifications
You must be signed in to change notification settings - Fork 86
Small, stylistic changes #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e05fdf0
2a05bc3
4cda281
3cf2110
8d1eed3
ecabe60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ extension Cassette { | |
| var dictionary: [String: AnyObject] { | ||
| return [ | ||
| "name": name, | ||
| "interactions": interactions.map() { $0.dictionary } | ||
| "interactions": interactions.map { $0.dictionary } | ||
| ] | ||
| } | ||
|
|
||
|
|
@@ -36,14 +36,10 @@ extension Cassette { | |
|
|
||
| self.name = name | ||
|
|
||
| var interactions = [Interaction]() | ||
| if let array = dictionary["interactions"] as? [[String: AnyObject]] { | ||
| for dictionary in array { | ||
| if let interaction = Interaction(dictionary: dictionary) { | ||
| interactions.append(interaction) | ||
| } | ||
| } | ||
| interactions = array.flatMap { Interaction(dictionary: $0) } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What?! Heck yes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to use this everywhere. Amazing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is very great ! |
||
| } else { | ||
| interactions = [] | ||
| } | ||
| self.interactions = interactions | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,13 +17,11 @@ class URLResonse: NSURLResponse { | |
|
|
||
| extension NSURLResponse { | ||
| var dictionary: [String: AnyObject] { | ||
| var dictionary = [String: AnyObject]() | ||
|
|
||
| if let url = URL?.absoluteString { | ||
| dictionary["url"] = url | ||
| return ["url": url] | ||
| } | ||
|
|
||
| return dictionary | ||
| return [:] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a little weird, but I'm into it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 I love how you love Swifts quirky features. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to clarify, what exactly is this, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming it's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Great! Thanks for clarifying.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @natebird |
||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh who knew?! Is this new?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been using this since day 1. I love trailing closure syntax. 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize the
()were optional if you did that. So great.