Class: SydneyAliasFile::AliasDefinition

Inherits:
SyntaxNode
  • Object
show all
Defined in:
lib/sydney/sydney_alias_file/node_extensions.rb

Instance Method Summary collapse

Instance Method Details

#commandObject

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

#shortcutObject

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_sObject

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