Class: RVM::Environment::AliasWrapper
- Inherits:
-
Object
- Object
- RVM::Environment::AliasWrapper
- Defined in:
- lib/rvm/environment/alias.rb
Overview
Provides a Ruby-like wrapper to the alias functionality.
Instance Method Summary collapse
-
#create(name, ruby_string) ⇒ Object
(also: #[]=)
Creates an alias with a given name and ruby string.
-
#delete(name) ⇒ Object
Deletes the given alias.
-
#initialize(parent) ⇒ AliasWrapper
constructor
A new instance of AliasWrapper.
-
#list ⇒ Object
(also: #all)
Returns a hash of all aliases.
-
#show(name) ⇒ Object
(also: #[])
Shows the value of a given alias.
Constructor Details
#initialize(parent) ⇒ AliasWrapper
Returns a new instance of AliasWrapper.
39 40 41 |
# File 'lib/rvm/environment/alias.rb', line 39 def initialize(parent) @parent = parent end |
Instance Method Details
#create(name, ruby_string) ⇒ Object Also known as: []=
Creates an alias with a given name and ruby string.
55 56 57 |
# File 'lib/rvm/environment/alias.rb', line 55 def create(name, ruby_string) @parent.alias_create name, ruby_string end |
#delete(name) ⇒ Object
Deletes the given alias.
50 51 52 |
# File 'lib/rvm/environment/alias.rb', line 50 def delete(name) @parent.alias_delete name end |
#list ⇒ Object Also known as: all
Returns a hash of all aliases.
61 62 63 |
# File 'lib/rvm/environment/alias.rb', line 61 def list @parent.alias_list end |
#show(name) ⇒ Object Also known as: []
Shows the value of a given alias.
44 45 46 |
# File 'lib/rvm/environment/alias.rb', line 44 def show(name) @parent.alias_show name end |