Module: TestBench::Controls::Time
- Defined in:
- lib/test_bench/controls/time.rb
Defined Under Namespace
Modules: Elapsed
Class Method Summary collapse
- .day ⇒ Object
- .example(seconds_offset: nil) ⇒ Object
- .hours ⇒ Object
- .minutes ⇒ Object
- .month ⇒ Object
- .seconds ⇒ Object
- .tz_offset ⇒ Object
- .year ⇒ Object
Class Method Details
.day ⇒ Object
38 39 40 |
# File 'lib/test_bench/controls/time.rb', line 38 def self.day 1 end |
.example(seconds_offset: nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/test_bench/controls/time.rb', line 4 def self.example(seconds_offset: nil) seconds_offset ||= 0 year = self.year month = self.month day = self.day hours = self.hours minutes = self.minutes seconds = self.seconds + seconds_offset if not RUBY_ENGINE == 'mruby' tz_offset = self.tz_offset final_argument = tz_offset else seconds, subseconds = seconds.divmod(1) microseconds = subseconds * 1_000_000 final_argument = microseconds end ::Time.new(year, month, day, hours, minutes, seconds, final_argument) end |
.hours ⇒ Object
42 43 44 |
# File 'lib/test_bench/controls/time.rb', line 42 def self.hours 11 end |
.minutes ⇒ Object
46 47 48 |
# File 'lib/test_bench/controls/time.rb', line 46 def self.minutes 11 end |
.month ⇒ Object
34 35 36 |
# File 'lib/test_bench/controls/time.rb', line 34 def self.month 1 end |
.seconds ⇒ Object
50 51 52 |
# File 'lib/test_bench/controls/time.rb', line 50 def self.seconds 11.0 end |
.tz_offset ⇒ Object
54 55 56 |
# File 'lib/test_bench/controls/time.rb', line 54 def self.tz_offset 0 end |
.year ⇒ Object
30 31 32 |
# File 'lib/test_bench/controls/time.rb', line 30 def self.year 2000 end |