This file contains 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
# Assuming we're in an irb terminal. | |
# Keep in mind: | |
# * The return value of assignment in Ruby is the thing you assigned. | |
# * Ruby includes syntactic sugar to invoke methods with no parentheses. So `puts` is equivalent to `puts()` | |
# So when we write `foo = puts`, we assign `foo` the return value of puts which is always nil. | |
# What we're actually saying (without the sugar) is: | |
# `foo = puts()` |
This file contains 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
var components = URLComponents() | |
components.port = -8080 | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.port = Int.max | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.port = -0 | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.port = 0 | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.scheme = "https://" | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.scheme = "" | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.scheme = "1234poop" | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.scheme = "poop1234" | |
components.url! |
This file contains 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
var components = URLComponents() | |
components.scheme = "poop1234" | |
components.host = "\t\t\n\nWHat?#$" | |
components.path = "/\\users-#what?" | |
components.port = Int.max | |
components.url! |
NewerOlder