Created
December 6, 2013 09:00
-
-
Save chensoren/7820703 to your computer and use it in GitHub Desktop.
Block Configuration
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
class Configuration | |
attr_accessor :username, :password | |
def initialize | |
yield self | |
end | |
end | |
c = Configuration.new do |config| | |
config.username = 'juan' | |
config.password = '123' | |
end | |
puts c.username | |
puts c.password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment