Class: Terry::BashAlias
- Inherits:
-
Object
- Object
- Terry::BashAlias
- Defined in:
- lib/terry/bash_alias.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#description ⇒ Object
Returns the value of attribute description.
-
#shortcode ⇒ Object
Returns the value of attribute shortcode.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(bash_alias) ⇒ BashAlias
constructor
A new instance of BashAlias.
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
#command ⇒ Object
Returns the value of attribute command.
4 5 6 |
# File 'lib/terry/bash_alias.rb', line 4 def command @command end |
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/terry/bash_alias.rb', line 4 def description @description end |
#shortcode ⇒ Object
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 |