Class: VibrateAction
- Inherits:
-
DeviceSettingsAction
- Object
- MacroObject
- Action
- DeviceSettingsAction
- VibrateAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Device Settings
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ VibrateAction
constructor
A new instance of VibrateAction.
- #to_s(colour: false, indent: 0) ⇒ Object
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ VibrateAction
Returns a new instance of VibrateAction.
1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 |
# File 'lib/ruby-macrodroid/actions.rb', line 1378 def initialize(h={}) pattern = [ 'Blip', 'Short Buzz', 'Long Buzz', 'Rapid', 'Slow', 'Increasing', 'Constant', 'Decreasing', 'Final Fantasy', 'Game Over', 'Star Wars', 'Mini Blip', 'Micro Blip' ] if h[:pattern] then h[:vibrate_pattern] = pattern.map(&:downcase).index h[:pattern] end = { vibrate_pattern: 1 } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 |
# File 'lib/ruby-macrodroid/actions.rb', line 1398 def to_s(colour: false, indent: 0) pattern = [ 'Blip', 'Short Buzz', 'Long Buzz', 'Rapid', 'Slow', 'Increasing', 'Constant', 'Decreasing', 'Final Fantasy', 'Game Over', 'Star Wars', 'Mini Blip', 'Micro Blip' ] 'Vibrate ' + "(%s)" % pattern[@h[:vibrate_pattern].to_i] end |