5 def initialize manifest, item
9 # return false unless self.resource.enable?
10 @item.extend self.engine_extend_module
11 @item.__send__ @manifest.setter_method_name, self.parsed_settings
19 # get engine resource from system resource manifest
20 def my_engine_resource
21 Manifest.manifest.system_resources.engine_resources[@item.table_name]
24 # get snake_case engine name
25 # ex) circle_speech_balloon
26 # use to url, model_name generating
28 self.my_engine_resource.resource_items[@item.classname]
32 self.engine_name + '_' + @manifest.extend_item_name
36 self.my_engine_resource.resource_items.include? @item.classname
39 # get engine's module name
41 @item.attributes[@manifest.extend_column_name]
45 @item.attributes[@manifest.settings_column_name]
48 # name space for engine
50 Object.const_get self.class_name
53 # extend module in engine
54 # ex) CircleSpeechBalloon::SpeechBalloonModule
55 def engine_extend_module
56 self.engine_module.const_get @manifest.extend_module_name
59 # extend settings data model in engine
60 # ex) CircleSpeechBalloon::SpeechBalloon
61 def engine_extend_model
62 self.engine_module.const_get @manifest.extend_model_name
65 # get system resource instance
67 r = @item.__send__ @manifest.name
68 raise 'resource not found' unless r
73 if self.settings.blank?
76 JSON.parse(self.settings)