Class: Time
- Inherits:
-
Object
- Object
- Time
- Defined in:
- lib/timecop/time_extensions.rb
Overview
:nodoc:
Class Method Summary collapse
- .mock_time ⇒ Object
- .new_with_mock_time(*args) ⇒ Object (also: new)
- .now_with_mock_time ⇒ Object (also: now)
Class Method Details
.mock_time ⇒ Object
6 7 8 9 |
# File 'lib/timecop/time_extensions.rb', line 6 def mock_time mocked_time_stack_item = Timecop.top_stack_item mocked_time_stack_item.nil? ? nil : mocked_time_stack_item.time(self) end |
.new_with_mock_time(*args) ⇒ Object Also known as: new
21 22 23 |
# File 'lib/timecop/time_extensions.rb', line 21 def new_with_mock_time(*args) args.size <= 0 ? now : new_without_mock_time(*args) end |
.now_with_mock_time ⇒ Object Also known as: now
13 14 15 |
# File 'lib/timecop/time_extensions.rb', line 13 def now_with_mock_time mock_time || now_without_mock_time end |