Class: RubyConfig::Switcher
- Inherits:
-
Object
- Object
- RubyConfig::Switcher
- Defined in:
- lib/ruby_config/switcher.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(ruby_config_path) ⇒ Switcher
constructor
A new instance of Switcher.
- #set_symlinks_to_runtime(runtime) ⇒ Object
- #switch(runtime) ⇒ Object
Constructor Details
#initialize(ruby_config_path) ⇒ Switcher
Returns a new instance of Switcher.
7 8 9 10 |
# File 'lib/ruby_config/switcher.rb', line 7 def initialize(ruby_config_path) @ruby_config_path = ruby_config_path @config = RubyConfig::Config.new(@ruby_config_path) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/ruby_config/switcher.rb', line 5 def config @config end |
Instance Method Details
#set_symlinks_to_runtime(runtime) ⇒ Object
17 18 19 20 21 |
# File 'lib/ruby_config/switcher.rb', line 17 def set_symlinks_to_runtime(runtime) delete_existing_symlinks create_symlinks(runtime) set_environment(runtime) end |
#switch(runtime) ⇒ Object
12 13 14 15 |
# File 'lib/ruby_config/switcher.rb', line 12 def switch(runtime) set_default_handle(runtime.handle) set_symlinks_to_runtime(runtime) end |