Class: GeofenceTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- GeofenceTrigger
- Defined in:
- lib/ruby-macrodroid.rb
Overview
Category: Location
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(geofence, h = {}) ⇒ GeofenceTrigger
constructor
A new instance of GeofenceTrigger.
- #to_s ⇒ Object
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(geofence, h = {}) ⇒ GeofenceTrigger
Returns a new instance of GeofenceTrigger.
1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 |
# File 'lib/ruby-macrodroid.rb', line 1884 def initialize(geofence, h={}) if h[:name] then found = geofence.find {|x| x.name == h[:name]} h[:geofence_id] = found.id end = { update_rate_text: '5 Minutes', geofence_id: '', geofence_update_rate_minutes: 5, trigger_from_unknown: false, enter_area: true } super(.merge filter(, h)) @geofence = geofence end |
Instance Method Details
#to_s ⇒ Object
1906 1907 1908 1909 1910 1911 1912 |
# File 'lib/ruby-macrodroid.rb', line 1906 def to_s() puts ' @geofence: ' + @geofence.inspect if $debug direction = @h[:enter_area] ? 'Entry' : 'Exit' "Geofence %s (%s)" % [direction, @geofence[@h[:geofence_id].to_sym].name] end |