Class: Rpremote::ConfigShow
- Inherits:
-
Object
- Object
- Rpremote::ConfigShow
- Defined in:
- lib/rpremote/config_show.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(defaults:, output:) ⇒ ConfigShow
constructor
A new instance of ConfigShow.
- #run(args) ⇒ Object
Constructor Details
#initialize(defaults:, output:) ⇒ ConfigShow
Returns a new instance of ConfigShow.
14 15 16 17 |
# File 'lib/rpremote/config_show.rb', line 14 def initialize(defaults:, output:) @defaults = defaults @output = output end |
Class Method Details
.run(args, defaults:, output:) ⇒ Object
10 11 12 |
# File 'lib/rpremote/config_show.rb', line 10 def self.run(args, defaults:, output:) new(defaults: defaults, output: output).run(args) end |
Instance Method Details
#run(args) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rpremote/config_show.rb', line 19 def run(args) = parser = option_parser() parser.parse!(args) raise ArgumentError, "usage: rpremote config show [options]" unless args.empty? raise ArgumentError, "--baud must be positive" unless [:baud].positive? raise ArgumentError, "--timeout must be positive" unless [:timeout].positive? () end |