It would be nice to have a more precise EpochTime type. I'm a Ruby newbie, but this seems to work for me;
class EpochFloatTime < Float
def load(value)
case value
when ::Float, ::Integer
::Time.at(value)
else value
end
end
def dump(value)
case value
when ::Float, ::Integer, ::Time then value.to_f
when ::DateTime then value.to_time.to_f
end
end
end
It would be nice to have a more precise EpochTime type. I'm a Ruby newbie, but this seems to work for me;
class EpochFloatTime < Float