Class: Tarantool::Client::IndexInfo

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

Overview

One index of a space as listed in _vindex.

Defined Under Namespace

Classes: Part

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#id ⇒ Object (readonly)

Returns the value of attribute id

Returns:

  • (Object) —

    the current value of id



6
7
8
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 6

def id
  @id
end

#name ⇒ Object (readonly)

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



6
7
8
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 6

def name
  @name
end

#parts ⇒ Object (readonly)

Returns the value of attribute parts

Returns:

  • (Object) —

    the current value of parts



6
7
8
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 6

def parts
  @parts
end

#type ⇒ Object (readonly)

Returns the value of attribute type

Returns:

  • (Object) —

    the current value of type



6
7
8
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 6

def type
  @type
end

#unique ⇒ Object (readonly)

Returns the value of attribute unique

Returns:

  • (Object) —

    the current value of unique



6
7
8
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 6

def unique
  @unique
end

Class Method Details

.from_tuple(tuple, fields) ⇒ Object



7
8
9
10
11
12
13
14
# File 'tarantool-client/lib/tarantool/client/index_info.rb', line 7

def self.from_tuple(tuple, fields)
  _space_id, id, name, type, opts, parts = tuple

  new(
    id:, name:, type:, unique: (opts || {}).fetch('unique', true),
    parts: (parts || []).map { |raw| IndexInfo::Part.from_raw(raw, fields) }
  )
end