Class: Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/data_magic/core_ext/integer.rb

Instance Method Summary collapse

Instance Method Details

#days_ago(format = '%D') ⇒ Object


7
8
9
10
# File 'lib/data_magic/core_ext/integer.rb', line 7

def days_ago(format = '%D')
  the_day = Date.today - self
  the_day.strftime(format)
end

#days_from_today(format = '%D') ⇒ Object


2
3
4
5
# File 'lib/data_magic/core_ext/integer.rb', line 2

def days_from_today(format = '%D')
  the_day = Date.today + self
  the_day.strftime(format)
end