method

rewrite_frags

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: Date

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_9_2_180) is shown here.

rewrite_frags(elem) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/date.rb, line 855
  def self.rewrite_frags(elem) # :nodoc:
    elem ||= {}
    if seconds = elem[:seconds]
      d,   fr = seconds.divmod(86400)
      h,   fr = fr.divmod(3600)
      min, fr = fr.divmod(60)
      s,   fr = fr.divmod(1)
      elem[:jd] = UNIX_EPOCH_IN_CJD + d
      elem[:hour] = h
      elem[:min] = min
      elem[:sec] = s
      elem[:sec_fraction] = fr
      elem.delete(:seconds)
      elem.delete(:offset)
    end
    elem
  end
Register or log in to add new notes.