Class: Railbow::Table::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label:, width: :auto, min_width: nil, max_width: nil, align: :left, truncate: false, truncate_fn: nil, sticky: false) ⇒ Column

Returns a new instance of Column.



8
9
10
11
12
13
14
15
16
17
# File 'lib/railbow/table/column.rb', line 8

def initialize(label:, width: :auto, min_width: nil, max_width: nil, align: :left, truncate: false, truncate_fn: nil, sticky: false)
  @label = label
  @width = width
  @min_width = min_width
  @max_width = max_width
  @align = align
  @truncate = truncate
  @truncate_fn = truncate_fn
  @sticky = sticky
end

Instance Attribute Details

#alignObject (readonly)

Returns the value of attribute align.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def align
  @align
end

#labelObject (readonly)

Returns the value of attribute label.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def label
  @label
end

#max_widthObject (readonly)

Returns the value of attribute max_width.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def max_width
  @max_width
end

#min_widthObject (readonly)

Returns the value of attribute min_width.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def min_width
  @min_width
end

#stickyObject (readonly)

Returns the value of attribute sticky.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def sticky
  @sticky
end

#truncateObject (readonly)

Returns the value of attribute truncate.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def truncate
  @truncate
end

#truncate_fnObject (readonly)

Returns the value of attribute truncate_fn.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def truncate_fn
  @truncate_fn
end

#widthObject (readonly)

Returns the value of attribute width.



6
7
8
# File 'lib/railbow/table/column.rb', line 6

def width
  @width
end

Instance Method Details

#fixed?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/railbow/table/column.rb', line 19

def fixed?
  width.is_a?(Integer)
end