module TriviaCrack::Parsers::TimeParser

Constants

TIME_FORMAT

Public Class Methods

parse(raw_data) click to toggle source

Internal: Parses a date_time string returned by the Trivia Crack API.

raw_data - The date_time string.

Examples

TriviaCrack::Parsers::TimeParser.parse "02/17/2015 21:47:19 EST"

Returns a Time object representation of the given string.

# File lib/triviacrack/parsers/time_parser.rb, line 20
def self.parse(raw_data)
  Time.strptime(raw_data, TIME_FORMAT)
end