Class: DayTrigger

Inherits:
Trigger show all
Defined in:
lib/ruby-macrodroid.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.



1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
# File 'lib/ruby-macrodroid.rb', line 1968

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



1985
1986
1987
# File 'lib/ruby-macrodroid.rb', line 1985

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