Class: TableInspector::Indexes

Inherits:
Object
  • Object
show all
Defined in:
lib/table_inspector/indexes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, column_name = nil, colorize: false) ⇒ Indexes



6
7
8
9
10
# File 'lib/table_inspector/indexes.rb', line 6

def initialize(klass, column_name = nil, colorize: false)
  @klass = klass
  @column_name = column_name
  @colorize = colorize
end

Instance Attribute Details

#column_nameObject (readonly)

Returns the value of attribute column_name.



4
5
6
# File 'lib/table_inspector/indexes.rb', line 4

def column_name
  @column_name
end

#klassObject (readonly)

Returns the value of attribute klass.



4
5
6
# File 'lib/table_inspector/indexes.rb', line 4

def klass
  @klass
end

Instance Method Details

#renderObject



12
13
14
15
16
17
18
19
20
# File 'lib/table_inspector/indexes.rb', line 12

def render
  render_title

  if column_name
    render_indexes_of_column
  else
    render_indexes
  end
end