Class: Aquatone::Command
- Inherits:
-
Object
- Object
- Aquatone::Command
- Defined in:
- lib/aquatone/command.rb
Direct Known Subclasses
Aquatone::Commands::Discover, Aquatone::Commands::Gather, Aquatone::Commands::Scan
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(options) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(options) ⇒ Command
Returns a new instance of Command.
5 6 7 |
# File 'lib/aquatone/command.rb', line 5 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/aquatone/command.rb', line 3 def @options end |
Class Method Details
.run(options) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/aquatone/command.rb', line 9 def self.run() self.new().execute! rescue Interrupt output("Caught interrupt; exiting.\n", true) rescue => e output(red("An unexpected error occurred: #{e.class}: #{e.}\n")) output("#{e.backtrace.join("\n")}\n") end |
Instance Method Details
#execute! ⇒ Object
18 19 20 |
# File 'lib/aquatone/command.rb', line 18 def execute! fail NotImplementedError, "Commands must overwrite #execute! method" end |