--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Reports the approximate distance in time between two Time or Date objects or integers as seconds. Set <tt>include_seconds</tt> to true if you want more detailed approximations when distance &lt; 1 min, 29 secs Distances are reported based on the following table:"
- !ruby/struct:SM::Flow::VERB 
  body: "  0 &lt;-&gt; 29 secs                                                             # =&gt; less than a minute\n  30 secs &lt;-&gt; 1 min, 29 secs                                                # =&gt; 1 minute\n  1 min, 30 secs &lt;-&gt; 44 mins, 29 secs                                       # =&gt; [2..44] minutes\n  44 mins, 30 secs &lt;-&gt; 89 mins, 29 secs                                     # =&gt; about 1 hour\n  89 mins, 29 secs &lt;-&gt; 23 hrs, 59 mins, 29 secs                             # =&gt; about [2..24] hours\n  23 hrs, 59 mins, 29 secs &lt;-&gt; 47 hrs, 59 mins, 29 secs                     # =&gt; 1 day\n  47 hrs, 59 mins, 29 secs &lt;-&gt; 29 days, 23 hrs, 59 mins, 29 secs            # =&gt; [2..29] days\n  29 days, 23 hrs, 59 mins, 30 secs &lt;-&gt; 59 days, 23 hrs, 59 mins, 29 secs   # =&gt; about 1 month\n  59 days, 23 hrs, 59 mins, 30 secs &lt;-&gt; 1 yr minus 1 sec                    # =&gt; [2..12] months\n  1 yr &lt;-&gt; 2 yrs minus 1 secs                                               # =&gt; about 1 year\n  2 yrs &lt;-&gt; max time or date                                                # =&gt; over [2..X] years\n"
- !ruby/struct:SM::Flow::P 
  body: "With <tt>include_seconds</tt> = true and the difference &lt; 1 minute 29 seconds:"
- !ruby/struct:SM::Flow::VERB 
  body: "  0-4   secs      # =&gt; less than 5 seconds\n  5-9   secs      # =&gt; less than 10 seconds\n  10-19 secs      # =&gt; less than 20 seconds\n  20-39 secs      # =&gt; half a minute\n  40-59 secs      # =&gt; less than a minute\n  60-89 secs      # =&gt; 1 minute\n"
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  from_time = Time.now\n  distance_of_time_in_words(from_time, from_time + 50.minutes)        # =&gt; about 1 hour\n  distance_of_time_in_words(from_time, 50.minutes.from_now)           # =&gt; about 1 hour\n  distance_of_time_in_words(from_time, from_time + 15.seconds)        # =&gt; less than a minute\n  distance_of_time_in_words(from_time, from_time + 15.seconds, true)  # =&gt; less than 20 seconds\n  distance_of_time_in_words(from_time, 3.years.from_now)              # =&gt; over 3 years\n  distance_of_time_in_words(from_time, from_time + 60.hours)          # =&gt; about 3 days\n  distance_of_time_in_words(from_time, from_time + 45.seconds, true)  # =&gt; less than a minute\n  distance_of_time_in_words(from_time, from_time - 45.seconds, true)  # =&gt; less than a minute\n  distance_of_time_in_words(from_time, 76.seconds.from_now)           # =&gt; 1 minute\n  distance_of_time_in_words(from_time, from_time + 1.year + 3.days)   # =&gt; about 1 year\n  distance_of_time_in_words(from_time, from_time + 4.years + 15.days + 30.minutes + 5.seconds) # =&gt; over 4 years\n\n  to_time = Time.now + 6.years + 19.days\n  distance_of_time_in_words(from_time, to_time, true)     # =&gt; over 6 years\n  distance_of_time_in_words(to_time, from_time, true)     # =&gt; over 6 years\n  distance_of_time_in_words(Time.now, Time.now)           # =&gt; less than a minute\n"
full_name: ActionView::Helpers::DateHelper#distance_of_time_in_words
is_singleton: false
name: distance_of_time_in_words
params: (from_time, to_time = 0, include_seconds = false)
visibility: public
