X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=lib%2Fmanifest%2Fprofiler.rb;h=d58dab3b2f1087bb7bbf2c7772acae5bc7a09c5c;hb=bb142403c2e9ea67ff85339a72feda708ed8ca9b;hp=7ab98ba2ff75d02b4fcebca13faa9f97e3f34673;hpb=582b4cdf60604911562e8253041754f392b3175f;p=pettanr%2Fpettanr.git diff --git a/lib/manifest/profiler.rb b/lib/manifest/profiler.rb index 7ab98ba2..d58dab3b 100644 --- a/lib/manifest/profiler.rb +++ b/lib/manifest/profiler.rb @@ -4,15 +4,16 @@ require_dependency "manifest/profiler/association" module Manifest class Profiler - include ProfilerModule def self.manager manifest, my_manifests - my_manifests.map {|item_name, profiler_manifest| - self.new(manifest, item_name, profiler_manifest) + profilers = {} + my_manifests.each {|item_name, profiler_manifest| + profilers[item_name] = self.new(manifest, item_name, profiler_manifest) } + profilers end attr :profiler_manifest, :item_name, :manifest, - :columns, :lists, :associations + :column_names, :lists, :associations def initialize manifest, item_name, profiler_manifest @manifest = manifest @item_name = item_name @@ -22,22 +23,22 @@ module Manifest end def set_default - @profiler_manifest['columns'] ||= [] + @profiler_manifest['column_names'] ||= [] @profiler_manifest['lists'] ||= {} @profiler_manifest['associations'] ||= {} end def init - @columns = @profiler_manifest['columns'] + @column_names = ['id'] + @profiler_manifest['column_names'] + ['created_at', 'updated_at'] @lists = {} @profiler_manifest['lists'].each {|list_name, list_manifest| - @lists[list_name] = List.new(self, list_name, list_manifest) + @lists[list_name] = ProfilerModule::List.new(self, list_name, list_manifest) } - @associations = Association.new(self, @profiler_manifest['associations']) + @associations = ProfilerModule::Association.new(self, @profiler_manifest['associations']) end - def open item, operators - ProfilerView.new @item_name, item, operators, @profiler_conf, @manifest + def each_column + @column_names end end