Class: TakePictureAction

Inherits:
CameraAction show all
Defined in:
lib/ruby-macrodroid.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 inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ TakePictureAction

Returns a new instance of TakePictureAction.



2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
# File 'lib/ruby-macrodroid.rb', line 2969

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



2983
2984
2985
2986
# File 'lib/ruby-macrodroid.rb', line 2983

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

#to_s(colour: false) ⇒ Object



2988
2989
2990
# File 'lib/ruby-macrodroid.rb', line 2988

def to_s(colour: false)
  'Take Picture'
end