OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / lib / local_manifest / filer.rb
1 ManifestBase.require_modules "local_manifest/filer/", 
2   %w|symbol caption summary icon date edit button|
3
4 module LocalManifest
5   class Filer < ManifestBase::Base
6     include FilerModule
7     
8     attr :item_class,
9       :symbol, :caption, :summary, :icon, :date, :edit, :button
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       @json['button'] ||= {}
21     end
22     
23     def init
24       super
25       @symbol = ManifestBase.load_type_args self, @json, 'symbol', SymbolFactory
26       @caption = ManifestBase.load_type_args self, @json, 'caption', CaptionFactory
27       @summary = ManifestBase.load_type_args self, @json, 'summary', SummaryFactory
28       @icon = ManifestBase.load_type_args self, @json, 'icon', IconFactory
29       @date = ManifestBase.load_type_args self, @json, 'date', DateFactory
30       @edit = ManifestBase.load_type_args self, @json, 'edit', EditFactory
31       @button = ManifestBase.load_type_args self, @json, 'button', ButtonFactory
32     end
33     
34     def item_name
35       @name
36     end
37     
38     def filer_name
39       @name
40     end
41     
42   end
43   
44 end
45