Sha256: 239f72cecdfa8d571b2e819f374394c9a9be3dc4178ae0f817ae3b5129f5d613

Contents?: true

Size: 351 Bytes

Versions: 32

Compression:

Stored size: 351 Bytes

Contents

class Numeric

  def nsdate
    NSDate.dateWithTimeIntervalSince1970(self)
  end

  def before(date)
    date - self
  end

  def ago
    self.before(NSDate.new)
  end

  def after(date)
    date + self
  end

  def hence
    self.after(NSDate.new)
  end

end


class Fixnum

  def nstimezone
    NSTimeZone.timeZoneForSecondsFromGMT(self)
  end

end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
sugarcube-1.6.2 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.6.1 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.6.0 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.9 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.8 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.7 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.6 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.5 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.4 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.3 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.2 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.1 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.5.0 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.4.6 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.4.5 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.4.4 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.4.3 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.4.2 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.4.1 lib/sugarcube-nsdate/numeric.rb
sugarcube-1.4.0 lib/sugarcube-nsdate/numeric.rb