Sha256: cac13c683bdb4609147169dde2fdc483cdedccecc9a03b522ff05033af45616d

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

module ClarkKent
  module ReportConfig
    module ClassMethods
      def filter_config(params)
        filter_option_class = ('ClarkKent::' + ((params[:kind] + '_option').camelcase)).constantize
        filter_option_class.new(params)
      end

      def column_config(params)
        ClarkKent::ReportColumnConfig.new(params)
      end
    end
    extend ClassMethods
    def self.included( other )
      other.extend( ClassMethods )
    end
  end
  class ReportColumnConfig
    attr_accessor :custom_select, :order_sql, :summarizable
    def initialize params = {}
      params.each { |key, value| send "#{key}=", value }
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
clark_kent-0.1.5 app/models/clark_kent/report_config.rb
clark_kent-0.1.4 app/models/clark_kent/report_config.rb
clark_kent-0.1.3 app/models/clark_kent/report_config.rb
clark_kent-0.1.2 app/models/clark_kent/report_config.rb
clark_kent-0.1.1 app/models/clark_kent/report_config.rb
clark_kent-0.1.0 app/models/clark_kent/report_config.rb