Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Fred
- @@tags_connection = {
- :adapter => "mysql",
- :username => "root",
- :password => "",
- :database => "INTERVIEW",
- :socket => "/var/run/mysqld/mysqld.sock"
- }
- def foo
- puts @@tags_connection[:database]
- end
- end
- def Fred.foo
- class_variable_set(:@@tags_connection[:database], 'toto')
- end
- Fred.foo
- Fred.new.foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement