Kiss A simpler, smarter web application framework for Ruby

Fixnum Subclass of Object

Description

Enables FixNum conversion to time duration values (in seconds).

Public Instance Methods

ago() source

5.minutes.ago = Time.now - 300

    # File lib/kiss/hacks.rb, line 69
  def ago
    Time.now - self
  end
    
days() source

1.days = 24.hours

    # File lib/kiss/hacks.rb, line 56
  def days
    self * 24.hours
  end
    
format_thousands() source

format thousands

    # File lib/kiss/hacks.rb, line 74
  def format_thousands
    to_s.reverse.gsub(/(\d{3})/,'\1,').sub(/\,(-?)$/,'\1').reverse
  end
    
hours() source

1.hours = 60.minutes = 3600 (seconds)

    # File lib/kiss/hacks.rb, line 60
  def hours
    self * 60.minutes
  end
    
minutes() source

1.minutes = 60 (seconds) 5.minutes = 300 (seconds)

    # File lib/kiss/hacks.rb, line 65
  def minutes
    self * 60
  end
    
weeks() source

2.weeks = 14.days

    # File lib/kiss/hacks.rb, line 52
  def weeks
    self * 7.days
  end
    

Disabled; run with $DEBUG to generate this.