class TimeOfDayConstraint

Category: Date/Time

Public Class Methods

new(h={}) click to toggle source
Calls superclass method Constraint::new
# File lib/ruby-macrodroid/constraints.rb, line 482
def initialize(h={})

  options = {
    end_hour: 8,
    end_minute: 0,
    start_hour: 22,
    start_minute: 0
  }

  super(options.merge h)

end

Public Instance Methods

to_s(colour: false, indent: 0) click to toggle source
# File lib/ruby-macrodroid/constraints.rb, line 495
def to_s(colour: false, indent: 0)
  a = @h[:start_hour], @h[:start_minute], @h[:end_hour], @h[:start_minute]
  'Time of Day ' + "%02d:%02d - %02d:%02d" % a    
end
Also aliased as: to_summary
to_summary(colour: false, indent: 0)
Alias for: to_s