Sha256: b2dee1cccc09b2bc037b49905ed50da9dde214d451decc8ca90654e6a875b374

Contents?: true

Size: 770 Bytes

Versions: 24

Compression:

Stored size: 770 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 :name, :order_sql, :custom_select, :link, :time_zone_column, :time_format, :summarizable, :includes, :joins, :extra_scopes, :where, :group
    def initialize params = {}
      params.each { |key, value| send "#{key}=", value }
    end

    def id
      name
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
clark_kent-0.9.2 app/models/clark_kent/report_config.rb
clark_kent-0.9.1 app/models/clark_kent/report_config.rb
clark_kent-0.9.0 app/models/clark_kent/report_config.rb
clark_kent-0.8.11 app/models/clark_kent/report_config.rb
clark_kent-0.8.10 app/models/clark_kent/report_config.rb
clark_kent-0.8.9 app/models/clark_kent/report_config.rb
clark_kent-0.8.8 app/models/clark_kent/report_config.rb
clark_kent-0.8.7 app/models/clark_kent/report_config.rb
clark_kent-0.8.6 app/models/clark_kent/report_config.rb
clark_kent-0.8.5 app/models/clark_kent/report_config.rb
clark_kent-0.8.4 app/models/clark_kent/report_config.rb
clark_kent-0.8.3 app/models/clark_kent/report_config.rb
clark_kent-0.8.2 app/models/clark_kent/report_config.rb
clark_kent-0.8.1 app/models/clark_kent/report_config.rb
clark_kent-0.7.1 app/models/clark_kent/report_config.rb
clark_kent-0.7.0 app/models/clark_kent/report_config.rb
clark_kent-0.6.1 app/models/clark_kent/report_config.rb
clark_kent-0.6.0 app/models/clark_kent/report_config.rb
clark_kent-0.5.0 app/models/clark_kent/report_config.rb
clark_kent-0.4.4 app/models/clark_kent/report_config.rb