Class: Tarantool::Client::IndexInfo::Part

Inherits:
Data
  • Object
show all
Defined in:
tarantool-client/lib/tarantool/client/index_info.rb

Overview

fieldno is 0-based; name comes from the space format and is nil for a field beyond it.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#fieldno ⇒ Object (readonly)

Returns the value of attribute fieldno

Returns:

  • (Object) —

    the current value of fieldno



18
19
20
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 18

def fieldno
  @fieldno
end

#is_nullable ⇒ Object (readonly)

Returns the value of attribute is_nullable

Returns:

  • (Object) —

    the current value of is_nullable



18
19
20
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 18

def is_nullable
  @is_nullable
end

#name ⇒ Object (readonly)

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



18
19
20
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 18

def name
  @name
end

#path ⇒ Object (readonly)

Returns the value of attribute path

Returns:

  • (Object) —

    the current value of path



18
19
20
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 18

def path
  @path
end

#type ⇒ Object (readonly)

Returns the value of attribute type

Returns:

  • (Object) —

    the current value of type



18
19
20
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 18

def type
  @type
end

Class Method Details

.from_raw(raw, fields) ⇒ Object

_vindex keeps parts either as [fieldno, type] or as a map with nullability and a JSON path.



20
21
22
23
24
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 20

def self.from_raw(raw, fields)
  fieldno, type, is_nullable, path = raw.is_a?(Hash) ? raw.values_at('field', 'type', 'is_nullable', 'path') : raw

  new(fieldno:, name: fields[fieldno]&.name, type:, is_nullable: is_nullable || false, path:)
end