Module: KazeClient::DataUtils

Defined in:
lib/kaze_client/data_utils.rb

Overview

Utility methods to interact with KazeData

Author:

Since:

  • 0.3.2

Class Method Summary collapse

Class Method Details

.parse_time(time) ⇒ Time

Parse a Kaze Workflow datetime

> 2019-01-01 00:00:00 UTC

Examples:

KazeClient::DataUtils.parse_datetime(1546300800000)

Parameters:

  • time (Integer)

    The datetime to parse

Returns:

  • (Time)

    The parsed datetime

Raises:

  • (ArgumentError)

Since:

  • 0.3.2



16
17
18
19
20
# File 'lib/kaze_client/data_utils.rb', line 16

def self.parse_time(time)
  raise ArgumentError, 'time must not be nil' unless time.nil?

  Time.at(time.to_i / 1000).utc
end