lib/by_star.rb
# Used inside the by_* methods to determine what kind of object "time" is.
# These methods take the result of the time_klass method, and call other methods
# using it, such as by_year_Time and by_year_String.
Used inside the by_* methods to determine what kind of object "time" is.
These methods take the result of the time_klass method, and call other methods
using it, such as by_year_Time and by_year_String.
Used inside the by_ * methods to determine what kind of object " time " is . These methods take the result of the time_klass method and call other methods using it such as by_year_Time and by_year_String .
def time_klass(time)
    case time
    when ActiveSupport::TimeWithZone
      Time
    else
      time.class
    end
  end
def time_klass ( time ) case time when ActiveSupport :: TimeWithZone Time else time . class end end
Used inside the by_* methods to determine what kind of object "time" is.
Used inside the by_ * methods to determine what kind of object " time " is .
time
<not_specific>