Class: TableCloth::ColumnJury

Inherits:
Object
  • Object
show all
Defined in:
lib/table_cloth/column_jury.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column, table) ⇒ ColumnJury

Returns a new instance of ColumnJury.



5
6
7
# File 'lib/table_cloth/column_jury.rb', line 5

def initialize(column, table)
  @column, @table = column, table
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



3
4
5
# File 'lib/table_cloth/column_jury.rb', line 3

def column
  @column
end

#tableObject (readonly)

Returns the value of attribute table.



3
4
5
# File 'lib/table_cloth/column_jury.rb', line 3

def table
  @table
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/table_cloth/column_jury.rb', line 9

def available?
  if options[:if] && options[:if].is_a?(Symbol)
    return !!table.send(options[:if])
  end

  if options[:unless] && options[:unless].is_a?(Symbol)
    return !table.send(options[:unless])
  end

  true
end

#optionsObject



21
22
23
# File 'lib/table_cloth/column_jury.rb', line 21

def options
  column.options
end