Class: HttpObjects::Parameters::DateTime

Inherits:
BasicRules::Base show all
Defined in:
lib/http_objects/parameters/date_time.rb

Overview

3.3. Date/Time Formats Examples

Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036

Instance Attribute Summary

Attributes inherited from BasicRules::Base

#raw, #value

Class Method Summary collapse

Methods inherited from BasicRules::Base

#initialize

Constructor Details

This class inherits a constructor from HttpObjects::Parameters::BasicRules::Base

Class Method Details

.parse(value) ⇒ Object



11
12
13
14
15
# File 'lib/http_objects/parameters/date_time.rb', line 11

def self.parse(value)
  raw = value
  value = Time.parse(value, true) rescue nil
  self.new(raw, value)
end