Sha256: e829f56d53de54a0038cbfb4f18298fff3a3cf7ae9545a119cab846c9b1a7f5f

Contents?: true

Size: 511 Bytes

Versions: 2

Compression:

Stored size: 511 Bytes

Contents

module Xporter
  class Exporter
    module DSL
      extend ActiveSupport::Concern

      included do
        private_class_method :column,
                             :model,
                             :transform
      end

      class_methods do
        def column(attribute_name, title = nil, &block)
          self._columns << Column.new(attribute_name, title, &block)
        end

        def model(resource_class)
          self._resource_class = resource_class
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xporter-0.2.0 lib/xporter/exporter/dsl.rb
xporter-0.1.0 lib/xporter/exporter/dsl.rb