Sha256: 32c41c52d4ecba4f384cc6f5729f59c76d0db78eb7cf2ea68e3bcea35fd5cd9c

Contents?: true

Size: 427 Bytes

Versions: 4

Compression:

Stored size: 427 Bytes

Contents

module Garb
  module ProfileReports
    def self.add_report_method(klass)
      # demodulize leaves potential to redefine
      # these methods given different namespaces
      method_name = klass.name.demodulize.underscore
      return unless method_name.length > 0

      class_eval <<-CODE
        def #{method_name}(opts = {}, &block)
          #{klass}.results(self, opts, &block)
        end
      CODE
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
titanous-garb-0.8.7 lib/garb/profile_reports.rb
titanous-garb-0.8.5 lib/garb/profile_reports.rb
garb-0.8.4 lib/garb/profile_reports.rb
garb-0.8.3 lib/garb/profile_reports.rb