Sha256: 4b63a4337644604cc1d5b8eb69544a11eefccc97097d2685f891e673c577a854

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

class Numeric

  def percent
    self / 100.0
  end

  def seconds
    self
  end
  alias :second :seconds

  def minutes
    self * 60
  end
  alias :minute :minutes

  def hours
    self * 3600
  end
  alias :hour :hours

  def later(user_info=nil, &fire)
    NSTimer.scheduledTimerWithTimeInterval(self.to_f, target: fire, selector: 'call:', userInfo: user_info, repeats: false)
  end

  def every(user_info=nil, &fire)
    NSTimer.scheduledTimerWithTimeInterval(self.to_f, target: fire, selector: 'call:', userInfo: user_info, repeats: true)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sugarcube-0.7.1 lib/sugarcube/numeric.rb