Class: SydneyAliasFile::AliasDefinition
- Inherits:
-
SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- SyntaxNode
- SydneyAliasFile::AliasDefinition
- Defined in:
- lib/sydney/sydney_alias_file/node_extensions.rb
Instance Method Summary collapse
-
#command ⇒ Object
Return the command to be executed in place of the alias.
-
#shortcut ⇒ Object
Return the command line shortcut (alias).
-
#to_s ⇒ Object
Return the alias definition without the preceding ‘alias’ and surrounding whitespace.
Instance Method Details
#command ⇒ Object
Return the command to be executed in place of the alias
77 78 79 80 |
# File 'lib/sydney/sydney_alias_file/node_extensions.rb', line 77 def command stripped_command = aliased_command.to_s.strip stripped_command[1,stripped_command.length - 2] end |
#shortcut ⇒ Object
Return the command line shortcut (alias)
72 73 74 |
# File 'lib/sydney/sydney_alias_file/node_extensions.rb', line 72 def shortcut prefix.text_value.strip end |
#to_s ⇒ Object
Return the alias definition without the preceding ‘alias’ and surrounding whitespace
67 68 69 |
# File 'lib/sydney/sydney_alias_file/node_extensions.rb', line 67 def to_s "#{shortcut} = #{command}" end |