Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Item returns DateTime objects now

  • Loading branch information...
commit cdf8556efe2fbd968e6d210d7b42ec6454089de1 1 parent c6f2d65
@dwillis dwillis authored
View
4 lib/times_wire/base.rb
@@ -29,8 +29,8 @@ def self.api_key
@@api_key
end
- def self.date_parser(date)
- date ? Date.parse(date) : nil
+ def self.datetime_parser(datetime)
+ datetime ? DateTime.parse(datetime) : nil
end
##
View
6 lib/times_wire/item.rb
@@ -19,9 +19,9 @@ def self.create_from_api(params={})
:byline => params['byline'],
:item_type => params['item_type'],
:source => params['source'],
- :updated_date => date_parser(params['updated_date']),
- :created_date => date_parser(params['created_date']),
- :published_date => date_parser(params['published_date']),
+ :updated_date => datetime_parser(params['updated_date']),
+ :created_date => datetime_parser(params['created_date']),
+ :published_date => datetime_parser(params['published_date']),
:material_type_facet => params['material_type_facet'],
:kicker => params['kicker'],
:subheadline => params['subheadline'],
View
2  lib/times_wire/version.rb
@@ -1,3 +1,3 @@
module TimesWire
- VERSION = "0.7.0"
+ VERSION = "0.8.0"
end
Please sign in to comment.
Something went wrong with that request. Please try again.