Sha256: 27de14c34948302aa01fcee7dd2b7a7577ea44a9da1f2753e663c185ebb951e9

Contents?: true

Size: 435 Bytes

Versions: 8

Compression:

Stored size: 435 Bytes

Contents

module TableCloth::Extensions::Actions
  class Column < ::TableCloth::Column
    def value(object, view, table=nil)
      actions = action_collection.actions.map do |action|
        action.value(object, view)
      end

      view.raw(actions.join(separator))
    end

    private

    def separator
      options[:separator] || " "
    end

    def action_collection
      @action_collection ||= options[:collection]
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
table_cloth-0.4.2 lib/table_cloth/extensions/actions/column.rb
table_cloth-0.4.1 lib/table_cloth/extensions/actions/column.rb
table_cloth-0.4.0 lib/table_cloth/extensions/actions/column.rb
table_cloth-0.3.2 lib/table_cloth/extensions/actions/column.rb
table_cloth-0.3.1.alpha1 lib/table_cloth/extensions/actions/column.rb
table_cloth-0.3.0.beta3 lib/table_cloth/extensions/actions/column.rb
table_cloth-0.3.0.beta2 lib/table_cloth/extensions/actions/column.rb
table_cloth-0.3.0.beta1 lib/table_cloth/extensions/actions/column.rb