Class: DateTime

Inherits:
Object
  • Object
show all
Defined in:
lib/oj/active_support_helper.rb

Overview

This is a hack to work around an oddness with DateTime and the ActiveSupport that causes a hang when some methods are called from C. Hour, min(ute), sec(ond) and other methods are special but they can be called from C until activesupport/time is required. After that they can not be even though resond_to? returns true. By defining methods to call super the problem goes away. There is obviously some magic going on under the covers that I don’t understand.

Instance Method Summary collapse

Instance Method Details

#hourObject



25
26
27
# File 'lib/oj/active_support_helper.rb', line 25

def hour()
  super
end

#minObject



28
29
30
# File 'lib/oj/active_support_helper.rb', line 28

def min()
  super
end

#offsetObject



37
38
39
# File 'lib/oj/active_support_helper.rb', line 37

def offset()
  super
end

#secObject



31
32
33
# File 'lib/oj/active_support_helper.rb', line 31

def sec()
  super
end

#sec_fractionObject



34
35
36
# File 'lib/oj/active_support_helper.rb', line 34

def sec_fraction()
  super
end