Sha256: 3b507bfaf6a7cbe40c2f54435835f105c47771f140b1415510bdd2b942a511d2

Contents?: true

Size: 553 Bytes

Versions: 23

Compression:

Stored size: 553 Bytes

Contents

class Brief::GenericReport
  attr_reader :document

  def initialize(document)
    @document = document
  end

  def briefcase
    document.try(:briefcase)
  end

  def entries
    []
  end

  def headers
    []
  end
end

module Brief::Model::Reports
  def generate_report report_type
    if data.reports && data.reports.fetch(report_type, nil)
      klass = data.reports.fetch(report_type.to_s)
      klass = Object.const_get(klass) unless klass.is_a?(Class)
    else
      klass = Brief::GenericReport
    end

    klass && klass.new(self)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
brief-1.17.14 lib/brief/model/reports.rb
brief-1.17.13 lib/brief/model/reports.rb
brief-1.17.12 lib/brief/model/reports.rb
brief-1.17.11 lib/brief/model/reports.rb
brief-1.17.10 lib/brief/model/reports.rb
brief-1.17.9 lib/brief/model/reports.rb
brief-1.17.8 lib/brief/model/reports.rb
brief-1.17.7 lib/brief/model/reports.rb
brief-1.17.5 lib/brief/model/reports.rb
brief-1.17.4 lib/brief/model/reports.rb
brief-1.17.3 lib/brief/model/reports.rb
brief-1.17.2 lib/brief/model/reports.rb
brief-1.17.1 lib/brief/model/reports.rb
brief-1.17.0 lib/brief/model/reports.rb
brief-1.16.2 lib/brief/model/reports.rb
brief-1.16.1 lib/brief/model/reports.rb
brief-1.16.0 lib/brief/model/reports.rb
brief-1.15.5 lib/brief/model/reports.rb
brief-1.15.4 lib/brief/model/reports.rb
brief-1.15.3 lib/brief/model/reports.rb