Class: D2L::Valence::TimestampError
- Inherits:
-
Object
- Object
- D2L::Valence::TimestampError
- Defined in:
- lib/d2l/valence/timestamp_error.rb
Overview
TimestampError
This class is aimed at parsing and providing diagnostics for time based issues between the D2L Brightspace Server and Ruby Client
Instance Method Summary collapse
-
#initialize(error_message) ⇒ TimestampError
constructor
A new instance of TimestampError.
-
#server_skew ⇒ Integer
Difference in D2L Server timestamp in seconds.
-
#timestamp_out_of_range? ⇒ Integer
True if our timestamp is out of range with the D2L Server.
Constructor Details
#initialize(error_message) ⇒ TimestampError
Returns a new instance of TimestampError.
8 9 10 |
# File 'lib/d2l/valence/timestamp_error.rb', line 8 def initialize() @error_message = end |
Instance Method Details
#server_skew ⇒ Integer
Returns difference in D2L Server timestamp in seconds.
13 14 15 16 17 |
# File 'lib/d2l/valence/timestamp_error.rb', line 13 def server_skew return 0 if server_time_in_seconds.nil? @server_skew ||= server_time_in_seconds - now_in_seconds end |
#timestamp_out_of_range? ⇒ Integer
Returns true if our timestamp is out of range with the D2L Server.
20 21 22 |
# File 'lib/d2l/valence/timestamp_error.rb', line 20 def server_time_in_seconds != nil end |