Class: TimeOfDayConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- TimeOfDayConstraint
- Defined in:
- lib/ruby-macrodroid.rb
Overview
Category: Date/Time
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ TimeOfDayConstraint
constructor
A new instance of TimeOfDayConstraint.
- #to_s(colour: false) ⇒ Object (also: #to_summary)
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ TimeOfDayConstraint
Returns a new instance of TimeOfDayConstraint.
5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 |
# File 'lib/ruby-macrodroid.rb', line 5127 def initialize(h={}) = { end_hour: 8, end_minute: 0, start_hour: 22, start_minute: 0 } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object Also known as: to_summary
5140 5141 5142 5143 |
# File 'lib/ruby-macrodroid.rb', line 5140 def to_s(colour: false) a = @h[:start_hour], @h[:start_minute], @h[:end_hour], @h[:start_minute] 'Time of Day ' + "%02d:%02d - %02d:%02d" % a end |