Class: TableInspector::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, column_name, presenter_option) ⇒ Column

Returns a new instance of Column.



7
8
9
10
11
# File 'lib/table_inspector/column.rb', line 7

def initialize(klass, column_name, presenter_option)
  @column = klass.columns.find { |column| column.name == column_name.to_s }
  @klass = klass
  @presenter = Presenter.current.new(klass, presenter_option)
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



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

def column
  @column
end

#klassObject (readonly)

Returns the value of attribute klass.



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

def klass
  @klass
end

#presenterObject (readonly)

Returns the value of attribute presenter.



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

def presenter
  @presenter
end

Instance Method Details

#renderObject



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

def render
  break_line # empty line
  render_title
  render_body
  break_line # empty line
  render_indexes
  break_line # empty line
end