Created
January 6, 2011 16:24
-
-
Save anlek/768112 to your computer and use it in GitHub Desktop.
external.config
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
c = Configuration.new | |
c.instance_eval(File.read('config_file.rb')) |
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
sql_connection do | |
host "127.0.0.1" | |
end |
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
class Configuration | |
def sql_connection | |
@sql_connection = SqlConnection.new | |
@sql_connection.instance_exec(Proc.new) if block_given? | |
end | |
end |
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
class SqlConnection | |
def host(value=nil) | |
@host = value if value | |
@host | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment