Class: Wheneverd::Trigger::Boot
- Inherits:
-
Object
- Object
- Wheneverd::Trigger::Boot
- Includes:
- Base
- Defined in:
- lib/wheneverd/trigger/boot.rb
Overview
A boot trigger, rendered as OnBootSec=.
Instance Attribute Summary collapse
- #seconds ⇒ Integer readonly
Instance Method Summary collapse
-
#initialize(seconds:) ⇒ Boot
constructor
A new instance of Boot.
-
#signature ⇒ String
Stable signature for unit naming.
-
#systemd_timer_lines ⇒ Array<String>
Systemd
[Timer]lines for this trigger.
Constructor Details
#initialize(seconds:) ⇒ Boot
Returns a new instance of Boot.
13 14 15 |
# File 'lib/wheneverd/trigger/boot.rb', line 13 def initialize(seconds:) @seconds = Validation.positive_integer(seconds, name: "Boot seconds") end |
Instance Attribute Details
#seconds ⇒ Integer (readonly)
10 11 12 |
# File 'lib/wheneverd/trigger/boot.rb', line 10 def seconds @seconds end |
Instance Method Details
#signature ⇒ String
Returns stable signature for unit naming.
23 24 25 |
# File 'lib/wheneverd/trigger/boot.rb', line 23 def signature "boot:#{seconds}" end |
#systemd_timer_lines ⇒ Array<String>
Returns systemd [Timer] lines for this trigger.
18 19 20 |
# File 'lib/wheneverd/trigger/boot.rb', line 18 def systemd_timer_lines ["OnBootSec=#{seconds}"] end |