Class: Terry::BashAlias

Inherits:
Object
  • Object
show all
Defined in:
lib/terry/bash_alias.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bash_alias) ⇒ BashAlias

Returns a new instance of BashAlias.



5
6
7
8
9
# File 'lib/terry/bash_alias.rb', line 5

def initialize(bash_alias)
  @shortcode = bash_alias["shortcode"]
  @description = bash_alias["description"]
  @command = bash_alias["command"]
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



4
5
6
# File 'lib/terry/bash_alias.rb', line 4

def command
  @command
end

#descriptionObject

Returns the value of attribute description.



4
5
6
# File 'lib/terry/bash_alias.rb', line 4

def description
  @description
end

#shortcodeObject

Returns the value of attribute shortcode.



4
5
6
# File 'lib/terry/bash_alias.rb', line 4

def shortcode
  @shortcode
end

Class Method Details

.format_for_terminal(aliases) ⇒ Object



11
12
13
14
15
16
# File 'lib/terry/bash_alias.rb', line 11

def self.format_for_terminal(aliases)
  aliases.each do |ba|
    puts "#{ba.shortcode} - #{ba.description} (#{ba.command})"
  end
  nil
end