Class: Fav::AddCommand
- Inherits:
-
WritableCommand
- Object
- FavCommand
- WritableCommand
- Fav::AddCommand
- Defined in:
- lib/fav.rb
Overview
A command to add a Fav
Instance Attribute Summary
Attributes inherited from FavCommand
#cli_options, #command_args, #command_name, #command_options, #config, #favs_file
Instance Method Summary collapse
-
#on_group(group) ⇒ Object
Add a grouped fav.
-
#on_non_group ⇒ Object
Add a non-grouped fav.
Methods inherited from WritableCommand
Methods inherited from FavCommand
#initialize, #post_group, #run!
Constructor Details
This class inherits a constructor from Fav::FavCommand
Instance Method Details
#on_group(group) ⇒ Object
Add a grouped fav
152 153 154 155 |
# File 'lib/fav.rb', line 152 def on_group(group) self.config.add_to_group(group, self.command_name, self.[:add]) info "Successfully added #{self.command_name} to the '#{group}' group!" end |
#on_non_group ⇒ Object
Add a non-grouped fav
158 159 160 161 |
# File 'lib/fav.rb', line 158 def on_non_group self.config.add(self.command_name, self.[:add]) info "Successfully added #{self.command_name}!" end |