Sha256: d2b1e78d37cf1485eb97fdad43b9e1a28af00c7b4137b35a690418193c1d1e6f

Contents?: true

Size: 465 Bytes

Versions: 9

Compression:

Stored size: 465 Bytes

Contents

module TableCloth
  class ColumnJury
    attr_reader :column, :table

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

    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

    def options
      column.options
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
table_cloth-0.4.3 lib/table_cloth/column_jury.rb
table_cloth-0.4.2 lib/table_cloth/column_jury.rb
table_cloth-0.4.1 lib/table_cloth/column_jury.rb
table_cloth-0.4.0 lib/table_cloth/column_jury.rb
table_cloth-0.3.2 lib/table_cloth/column_jury.rb
table_cloth-0.3.1.alpha1 lib/table_cloth/column_jury.rb
table_cloth-0.3.0.beta3 lib/table_cloth/column_jury.rb
table_cloth-0.3.0.beta2 lib/table_cloth/column_jury.rb
table_cloth-0.3.0.beta1 lib/table_cloth/column_jury.rb