OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / lib / local_manifest / filer.rb
1 ManifestBase.require_modules "local_manifest/filer/", 
2   %w|symbol caption summary icon date edit|
3
4 module LocalManifest
5   class Filer < ManifestBase::Base
6     include FilerModule
7     
8     attr :item_class,
9       :symbol, :caption, :summary, :icon, :date, :edit
10     
11     def set_default
12       super
13       @item_class = ::Manifest.item_name_to_model @name
14       @json['symbol'] ||= {}
15       @json['caption'] ||= {}
16       @json['summary'] ||= {}
17       @json['icon'] ||= {}
18       @json['date'] ||= {}
19       @json['edit'] ||= {}
20     end
21     
22     def init
23       super
24       @symbol = ManifestBase.load_type_args self, @json, 'symbol', SymbolFactory
25       @caption = ManifestBase.load_type_args self, @json, 'caption', CaptionFactory
26       @summary = ManifestBase.load_type_args self, @json, 'summary', SummaryFactory
27       @icon = ManifestBase.load_type_args self, @json, 'icon', IconFactory
28       @date = ManifestBase.load_type_args self, @json, 'date', DateFactory
29       @edit = ManifestBase.load_type_args self, @json, 'edit', EditFactory
30     end
31     
32     def item_name
33       @name
34     end
35     
36     def filer_name
37       @name
38     end
39     
40   end
41   
42 end
43