Class: Tarantool::Client::IndexInfo::Part
- Inherits:
-
Data
- Object
- Data
- Tarantool::Client::IndexInfo::Part
- 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
-
#fieldno ⇒ Object
readonly
Returns the value of attribute fieldno.
-
#is_nullable ⇒ Object
readonly
Returns the value of attribute is_nullable.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
-
.from_raw(raw, fields) ⇒ Object
_vindex keeps parts either as [fieldno, type] or as a map with nullability and a JSON path.
Instance Attribute Details
#fieldno ⇒ Object (readonly)
Returns the value of attribute 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
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
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
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
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 |