Class: Thrift::Types::Known::Timestamp::Timestamp
- Inherits:
-
Object
- Object
- Thrift::Types::Known::Timestamp::Timestamp
show all
- Includes:
- Struct, Struct_Union
- Defined in:
- lib/thrift/types/known/timestamp/timestamp.rb,
lib/thrift/types/known/timestamp/timestamp_types.rb,
lib/thrift/types/known/timestamp/timestamp_types.rb
Constant Summary
collapse
- NAME =
'Timestamp'.freeze
- NAMESPACE =
'types.known.timestamp'.freeze
- LEGACY_ANNOTATIONS =
{
}.freeze
- STRUCTURED_ANNOTATIONS =
[
].freeze
- THRIFT_FIELD_INDEX_SECONDS =
1
- THRIFT_FIELD_INDEX_NANOS =
2
- THRIFT_FIELD_SECONDS_LEGACY_ANNOTATIONS =
{
}.freeze
- THRIFT_FIELD_SECONDS_STRUCTURED_ANNOTATIONS =
[
].freeze
- THRIFT_FIELD_NANOS_LEGACY_ANNOTATIONS =
{
}.freeze
- THRIFT_FIELD_NANOS_STRUCTURED_ANNOTATIONS =
[
].freeze
- FIELDS =
{
THRIFT_FIELD_INDEX_SECONDS => {type: ::Thrift::Types::I64, name: 'seconds', legacy_annotations: THRIFT_FIELD_SECONDS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_SECONDS_STRUCTURED_ANNOTATIONS},
THRIFT_FIELD_INDEX_NANOS => {type: ::Thrift::Types::I32, name: 'nanos', legacy_annotations: THRIFT_FIELD_NANOS_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_NANOS_STRUCTURED_ANNOTATIONS}
}.freeze
Struct_Union::CONTAINER_TYPES
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Struct
#<=>, #==, append_features, #differences, #eql?, field_accessor, #fields_with_default_values, generate_accessors, #hash, #initialize, #inspect, qmark_isset_method, #read, #write
#each_field, #field_info, #inspect_collection, #inspect_field, #is_container?, #name_to_id, #read_field, #sorted_field_ids, #write_container, #write_data
Class Method Details
.from_time(v) ⇒ Object
19
20
21
|
# File 'lib/thrift/types/known/timestamp/timestamp.rb', line 19
def from_time(v)
Timestamp.new(seconds: v.to_i, nanos: v.nsec)
end
|
Instance Method Details
#struct_fields ⇒ Object
47
|
# File 'lib/thrift/types/known/timestamp/timestamp_types.rb', line 47
def struct_fields; FIELDS; end
|
#to_time ⇒ Object
24
25
26
|
# File 'lib/thrift/types/known/timestamp/timestamp.rb', line 24
def to_time
Time.at(seconds, nanos, :nsec)
end
|