class Thrift::Types::Known::Timestamp::Timestamp

Constants

FIELDS
NAME
NAMESPACE
THRIFT_FIELD_INDEX_NANOS
THRIFT_FIELD_INDEX_SECONDS

Public Class Methods

from_time(v) click to toggle source
   # File lib/thrift/types/known/timestamp.rb
19 def from_time(v)
20   Timestamp.new(seconds: v.to_i, nanos: v.nsec)
21 end

Public Instance Methods

struct_fields() click to toggle source
   # File lib/thrift/types/known/timestamp_types.rb
29 def struct_fields; FIELDS; end
to_time() click to toggle source
   # File lib/thrift/types/known/timestamp.rb
24 def to_time
25   Time.at(seconds, nanos, :nsec)
26 end
validate() click to toggle source
   # File lib/thrift/types/known/timestamp_types.rb
31 def validate
32   raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field seconds is unset!') unless @seconds
33   raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nanos is unset!') unless @nanos
34 end