lib/triviacrack/parsers/time_parser.rb in triviacrack-0.6.0 vs lib/triviacrack/parsers/time_parser.rb in triviacrack-0.7.0
- old
+ new
@@ -1,15 +1,16 @@
-require "time"
+# frozen_string_literal: true
+require 'time'
+
# Internal: This module is used to parse date_time strings returned by the
# Trivia Crack API.
module TriviaCrack
module Parsers
module TimeParser
+ TIME_FORMAT = '%m/%d/%Y %H:%M:%S'
- TIME_FORMAT = "%m/%d/%Y %H:%M:%S"
-
# Internal: Parses a date_time string returned by the Trivia Crack API.
#
# raw_data - The date_time string.
#
# Examples
@@ -18,9 +19,8 @@
#
# Returns a Time object representation of the given string.
def self.parse(raw_data)
Time.strptime(raw_data, TIME_FORMAT)
end
-
end
end
end