Class: Thrift::Types::Value::ListValue

Inherits:
Object
  • Object
show all
Includes:
Struct, Struct_Union
Defined in:
lib/thrift/types/value/value.rb,
lib/thrift/types/value/value_types.rb,
lib/thrift/types/value/value_types.rb

Constant Summary collapse

NAME =
'ListValue'.freeze
NAMESPACE =
'types.value'.freeze
LEGACY_ANNOTATIONS =
{
}.freeze
STRUCTURED_ANNOTATIONS =
[
].freeze
THRIFT_FIELD_INDEX_VALUES =
1
THRIFT_FIELD_VALUES_LEGACY_ANNOTATIONS =
{
}.freeze
THRIFT_FIELD_VALUES_STRUCTURED_ANNOTATIONS =
[
].freeze
FIELDS =
{
  THRIFT_FIELD_INDEX_VALUES => {type: ::Thrift::Types::LIST, name: 'values', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}, legacy_annotations: THRIFT_FIELD_VALUES_LEGACY_ANNOTATIONS, structured_annotations: THRIFT_FIELD_VALUES_STRUCTURED_ANNOTATIONS}
}

Constants included from Struct_Union

Struct_Union::CONTAINER_TYPES

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Struct

#<=>, #==, #differences, #eql?, field_accessor, #fields_with_default_values, generate_accessors, #hash, #initialize, #inspect, qmark_isset_method, #read, #write

Methods included from Struct_Union

#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_array(v) ⇒ Object



12
13
14
# File 'lib/thrift/types/value/value.rb', line 12

def from_array(v)
  ListValue.new(values: v.map { |vv| Value.from_object(vv) })
end

Instance Method Details

#struct_fieldsObject



74
# File 'lib/thrift/types/value/value_types.rb', line 74

def struct_fields; FIELDS; end

#to_arrayObject



7
8
9
# File 'lib/thrift/types/value/value.rb', line 7

def to_array
  values.map(&:to_object)
end

#validateObject



76
77
78
# File 'lib/thrift/types/value/value_types.rb', line 76

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
end