Module: PuppetX::PuppetLabs::ScheduledTask::Trigger Private

Defined in:
lib/puppet_x/puppetlabs/scheduled_task/trigger.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

PuppetX::PuppetLabs::ScheduledTask::Trigger module

Defined Under Namespace

Classes: Duration, Manifest, V2

Class Method Summary collapse

Class Method Details

.iso8601_datetime_to_local(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Converts a datetime to local time with no timezone

Raises:

  • (ArgumentError)


70
71
72
73
74
75
76
77
# File 'lib/puppet_x/puppetlabs/scheduled_task/trigger.rb', line 70

def iso8601_datetime_to_local(value)
  return nil if value.nil?
  raise ArgumentError, 'value must be a String' unless value.is_a?(String)
  return nil if value.empty?

  # defaults to parsing as local with no timezone passed
  Time.parse(value).getlocal
end