Class: TakePictureAction

Inherits:
CameraAction show all
Defined in:
lib/ruby-macrodroid.rb

Overview

Category: Camera/Photo

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ TakePictureAction

Returns a new instance of TakePictureAction.



2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
# File 'lib/ruby-macrodroid.rb', line 2469

def initialize(h={})

  options = {
    new_path: '/storage/sdcard1/DCIM/Camera',
    path: '/storage/sdcard1/DCIM/Camera',
    show_icon: true,
    use_front_camera: true,
    flash_option: 0
  }

  super(options.merge h)

end

Instance Method Details

#to_pcObject



2483
2484
2485
2486
# File 'lib/ruby-macrodroid.rb', line 2483

def to_pc()
  camera = @h[:use_front_camera] ? :front : :back
  'take_photo :' + camera.to_s
end

#to_sObject



2488
2489
2490
# File 'lib/ruby-macrodroid.rb', line 2488

def to_s()
  'Take Picture'
end