module DataBuilder::DateGeneration

Public Instance Methods

day_of_week() click to toggle source
# File lib/data_builder/generation_date.rb, line 25
def day_of_week
  randomize(Date::DAYNAMES)
end
Also aliased as: db_day_of_week
day_of_week_abbr() click to toggle source
# File lib/data_builder/generation_date.rb, line 29
def day_of_week_abbr
  randomize(Date::ABBR_DAYNAMES)
end
Also aliased as: db_day_of_week_abbr
db_day_of_week()
Alias for: day_of_week
db_day_of_week_abbr()
Alias for: day_of_week_abbr
db_month()
Alias for: month
db_month_abbr()
Alias for: month_abbr
db_today(format = '%D')
Alias for: today
db_yesterday(format = '%D')
Alias for: yesterday
dn_tomorrow(format = '%D')
Alias for: tomorrow
month() click to toggle source
# File lib/data_builder/generation_date.rb, line 17
def month
  randomize(Date::MONTHNAMES[1..-1])
end
Also aliased as: db_month
month_abbr() click to toggle source
# File lib/data_builder/generation_date.rb, line 21
def month_abbr
  randomize(Date::ABBR_MONTHNAMES[1..-1])
end
Also aliased as: db_month_abbr
today(format = '%D') click to toggle source
# File lib/data_builder/generation_date.rb, line 3
def today(format = '%D')
  Date.today.strftime(format)
end
Also aliased as: db_today
tomorrow(format = '%D') click to toggle source
# File lib/data_builder/generation_date.rb, line 7
def tomorrow(format = '%D')
  tomorrow = Date.today + 1
  tomorrow.strftime(format)
end
Also aliased as: dn_tomorrow
yesterday(format = '%D') click to toggle source
# File lib/data_builder/generation_date.rb, line 12
def yesterday(format = '%D')
  yesterday = Date.today - 1
  yesterday.strftime(format)
end
Also aliased as: db_yesterday