OSDN Git Service

e
[pettanr/pettanr.git] / lib / peta / item.rb
index f9a3de7..b8b889a 100644 (file)
@@ -88,6 +88,28 @@ module Peta
     
     #InstanceMethods
     
+    def self.fold_extend_settings params
+      speech_balloon_settings = params[:speech_balloon][:settings]
+      if speech_balloon_settings.is_a?(Hash)
+        params[:speech_balloon][:settings] = speech_balloon_settings.to_json
+      end
+      balloon_settings = params[:speech_balloon][:balloon_attributes][:settings]
+      if balloon_settings.is_a?(Hash)
+        params[:speech_balloon][:balloon_attributes][:settings] = balloon_settings.to_json
+      end
+      speech_settings = params[:speech_balloon][:speech_attributes][:settings]
+      if speech_settings.is_a?(Hash)
+        params[:speech_balloon][:speech_attributes][:settings] = speech_settings.to_json
+      end
+    end
+    
+    def extend_engine_module
+      self.extend self.speech_balloon_template.engine_speech_balloon_module
+      self.elements.each do |element|
+        element.extend_item
+      end
+    end
+    
     def item_name
       self.class.item_name
     end