Class: Confinicky::Controllers::Aliases

Inherits:
Commands
  • Object
show all
Defined in:
lib/confinicky/controllers/aliases.rb

Overview

A subclass of the command group controller specifically for managing alias statements.

Instance Attribute Summary

Attributes inherited from Commands

#path

Instance Method Summary collapse

Methods inherited from Commands

#backup!, #clean!, #duplicates, #find, #inspect, #length, #remove!, #set!, #to_table

Constructor Details

#initializeAliases

Returns a new instance of Aliases.



8
9
10
11
12
# File 'lib/confinicky/controllers/aliases.rb', line 8

def initialize
  super(file_type_key: :aliases)
  @commands = @shell_file.aliases
  @table_title = "Aliases"
end

Instance Method Details

#save!Object

Updates the actual shell file on disk.



16
17
18
19
# File 'lib/confinicky/controllers/aliases.rb', line 16

def save!
  @shell_file.aliases = @commands
  @shell_file.write!
end