Class: TakePictureAction

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

Overview

Category: Camera/Photo

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods included from ObjectX

#action_to_object, #object_create, #varify

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ TakePictureAction

Returns a new instance of TakePictureAction.



287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/ruby-macrodroid/actions.rb', line 287

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



301
302
303
304
# File 'lib/ruby-macrodroid/actions.rb', line 301

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

#to_s(colour: false, indent: 0) ⇒ Object



306
307
308
# File 'lib/ruby-macrodroid/actions.rb', line 306

def to_s(colour: false, indent: 0)
  'Take Picture'
end