This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
func generateEquatable(_ t: Any) -> String { | |
var output = "" | |
let mirrorPlace = Mirror(reflecting: t) | |
let type = mirrorPlace.subjectType | |
output += ("extension \(type): Equatable {\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo | |
def bar | |
@bar ||= self.snakes | |
end | |
end | |
class Baz | |
def self.snakes | |
[:cobra] |