Class: RegularIntervalTrigger

Inherits:
Trigger show all
Defined in:
lib/ruby-macrodroid/triggers.rb

Overview

Category: Date/Time

Regular Interval

Instance Attribute Summary

Attributes inherited from Trigger

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Trigger

#match?

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ RegularIntervalTrigger

Returns a new instance of RegularIntervalTrigger.



837
838
839
840
841
842
843
844
845
846
847
848
849
850
# File 'lib/ruby-macrodroid/triggers.rb', line 837

def initialize(h={})

  options = {
    ignore_reference_start_time: false,
    minutes: 0,
    seconds: 7200,
    start_hour: 9,
    start_minute: 10,
    use_alarm: false
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object Also known as: to_summary



852
853
854
855
856
857
858
# File 'lib/ruby-macrodroid/triggers.rb', line 852

def to_s(colour: false)
  
  interval = Subunit.new(units={minutes:60, hours:60}, \
                         seconds: @h[:seconds]).strfunit("%c")
  'Regular Interval ' + "\n  Interval: " + interval
  
end