Sha256: b371844232769cd674fc03ea87e604ef9705fe3bce5dd814bc9ac5c2e6cad1d8

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

class MetaReports::Report

  #
  # Shared colors. The key is the class name, value is RGB in hex format
  #
  # Example: "highlight: 'ffcccc'" is 'tr.highlight {background: #ffcccc}' in CSS, and "$highlight: #ffcccc;"" as a SASS variable.
  #

  COLORS = {
    even:                   'efefef',
    odd:                    'ffffff',
    yellow:                 ['ffffaa', 'ffffcc', 'f9f9a4', 'f9f9c6'],
    highlight:          '$yellow_1 !important',
  }


  #
  # Reports
  #

  def self.example_report(params)
    {title: 'Example Report', subtitle: 'this is a test report', tables: {'Table 1' => [['One','Two','Three'],[1,2,3]]}}
    MetaReports::Data.new do |d|
      d.title = 'Example Report'
      d.subtitle = 'Of the Testing Kind'
      d.description = 'This is a test report.'
      d.tables["Table 1"] = MetaReports::Table.new do |t|
        t << ['One', 'Two', 'Three']
        t << [1, 2, 3]
        t << [4, "#{params[:disco]} Moo", 'No Way!']
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
meta_reports-0.0.5 lib/generators/meta_reports/templates/models/report_non_activerecord.rb