Class: Faker::Time

Inherits:
Date show all
Defined in:
lib/faker/time.rb

Constant Summary collapse

TIME_RANGES =
{
  :all => (0..23),
  :day => (9..17),
  :night => (18..23),
  :morning => (6..11),
  :afternoon => (12..17),
  :evening => (17..21),
  :midnight => (0..4)
}

Constants inherited from Base

Base::Letters, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Date

between_except, birthday

Methods inherited from Base

bothify, fetch, fetch_all, flexible, letterify, method_missing, numerify, parse, rand_in_range, regexify, translate, with_locale

Class Method Details

.backward(days = 365, period = :all) ⇒ Object



22
23
24
# File 'lib/faker/time.rb', line 22

def backward(days = 365, period = :all)
  date_with_random_time(super(days), period)
end

.between(from, to, period = :all) ⇒ Object



14
15
16
# File 'lib/faker/time.rb', line 14

def between(from, to, period = :all)
  date_with_random_time(super(from, to), period)
end

.forward(days = 365, period = :all) ⇒ Object



18
19
20
# File 'lib/faker/time.rb', line 18

def forward(days = 365, period = :all)
  date_with_random_time(super(days), period)
end