Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

use own constant instead of relying on 3rd party

  • Loading branch information...
commit 4589cf135e8001341c5247b6c3104728ccdc1bff 1 parent 981410c
Christian Meier authored

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. +3 1 lib/ixtlan/babel/factory.rb
4 lib/ixtlan/babel/factory.rb
@@ -2,6 +2,8 @@ module Ixtlan
2 2 module Babel
3 3 class Factory
4 4
  5 + NANOSECONDS_IN_DAY = Rational(1, 86400*10**9)
  6 +
5 7 class EmptyArraySerializer < Array
6 8 def use(arg)
7 9 self
@@ -11,7 +13,7 @@ def use(arg)
11 13 def initialize(custom_serializers = {})
12 14 @map = {}
13 15 add('DateTime') do |dt|
14   - dt.strftime('%Y-%m-%dT%H:%M:%S.') + ("%06d" % (dt.sec_fraction / Date::NANOSECONDS_IN_DAY / 1000)) + dt.strftime('%z')
  16 + dt.strftime('%Y-%m-%dT%H:%M:%S.') + ("%06d" % (dt.sec_fraction / NANOSECONDS_IN_DAY / 1000)) + dt.strftime('%z')
15 17 end
16 18 add('ActiveSupport::TimeWithZone') do |tz|
17 19 tz.strftime('%Y-%m-%dT%H:%M:%S.') + ("%06d" % tz.usec) + tz.strftime('%z')

0 comments on commit 4589cf1

Please sign in to comment.
Something went wrong with that request. Please try again.