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
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