Class: DayTrigger

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

Overview

Category: Date/Time

Also known as Day of Week/Month

month_of_year equal to 0 means it occurs every month day_of_week starts with a Monday (value is 0)

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 = {}) ⇒ DayTrigger

Returns a new instance of DayTrigger.



794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
# File 'lib/ruby-macrodroid/triggers.rb', line 794

def initialize(h={})

  options = {
    alarm_id: uuid(),
    hour: 9,
    minute: 0,
    month_of_year: 0,
    option: 0,
    day_of_week: 2,
    day_of_month: 0,
    use_alarm: false
  }

  super(options.merge h)

end

Instance Method Details

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



811
812
813
# File 'lib/ruby-macrodroid/triggers.rb', line 811

def to_s(colour: false)
  'DayTrigger ' + @h.inspect
end