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



2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
# File 'lib/ruby-macrodroid.rb', line 2298

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



2312
2313
2314
2315
# File 'lib/ruby-macrodroid.rb', line 2312

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

#to_sObject



2317
2318
2319
# File 'lib/ruby-macrodroid.rb', line 2317

def to_s()
  'Take Picture'
end