Class: Shiba::IndexStats::Index

Inherits:
Struct
  • Object
show all
Defined in:
lib/shiba/index_stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#columnsObject

Returns the value of attribute columns

Returns:

  • (Object)

    the current value of columns



58
59
60
# File 'lib/shiba/index_stats.rb', line 58

def columns
  @columns
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



58
59
60
# File 'lib/shiba/index_stats.rb', line 58

def name
  @name
end

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of table



58
59
60
# File 'lib/shiba/index_stats.rb', line 58

def table
  @table
end

#uniqueObject

Returns the value of attribute unique

Returns:

  • (Object)

    the current value of unique



58
59
60
# File 'lib/shiba/index_stats.rb', line 58

def unique
  @unique
end

Instance Method Details

#add_column(column_name, cardinality) ⇒ Object



59
60
61
# File 'lib/shiba/index_stats.rb', line 59

def add_column(column_name, cardinality)
  columns << Column.new(self, column_name, cardinality)
end

#encode_with(coder) ⇒ Object



63
64
65
66
67
68
69
# File 'lib/shiba/index_stats.rb', line 63

def encode_with(coder)
  coder.map = self.to_h.stringify_keys
  coder.map.delete('table')
  coder.map.delete('unique') unless unique

  coder.tag = nil
end