Last active
August 29, 2015 14:02
-
-
Save sbellware/9feec4cd74e563c36f8c to your computer and use it in GitHub Desktop.
Initializers only record parameters
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
| def Connection | |
| def initialize(connection_string) | |
| @connection_string = connection_string | |
| end | |
| def self.connect(connection_string) | |
| instance = build connection_string | |
| instance.connect | |
| instance | |
| end | |
| def self.build(connection_string) | |
| instance = new connection_string | |
| instance.logger = configure_logger | |
| instance | |
| end | |
| def connect | |
| # ... | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment