Class: Temporal::Instant

Inherits:
Object
  • Object
show all
Defined in:
lib/temporal/instant.rb

Instance Method Summary collapse

Constructor Details

#initialize(timestamp) ⇒ Instant

Returns a new instance of Instant.



9
10
11
# File 'lib/temporal/instant.rb', line 9

def initialize(timestamp)
  self.timestamp = timestamp
end

Instance Method Details

#epoch_millisecondsObject



13
# File 'lib/temporal/instant.rb', line 13

def epoch_milliseconds = (@timestamp / 1_000_000_000).truncate

#epoch_nanosecondsObject



14
# File 'lib/temporal/instant.rb', line 14

def epoch_nanoseconds =  @timestamp / 1_000