Class: Rubycam::CLI::Commands::Set

Inherits:
VideoCommand
  • Object
show all
Defined in:
lib/rubycam/cli.rb

Instance Method Summary collapse

Instance Method Details

#call(control:, value:, **options) ⇒ Object



117
118
119
120
121
122
123
124
125
# File 'lib/rubycam/cli.rb', line 117

def call(control:, value:, **options)
  with_device(options) do |dev|
    ctrl = fetch_control(dev, control)
    ctrl.value = Integer(value)
    puts "#{ctrl.key} = #{ctrl.value}"
  end
rescue ArgumentError
  abort "rubycam: value must be an integer, got #{value.inspect}"
end