+ def get_speech
+ self.speech || @new_speech
+ end
+
+ def boost
+ self.extend self.speech_balloon_template.engine_speech_balloon_module
+ if self.balloon
+ else
+ self.new_balloon = self.build_balloon
+ self.new_speech = self.build_speech
+ end
+ self.balloon.extend self.speech_balloon_template.engine_balloon_module
+ self.speech.extend self.speech_balloon_template.engine_speech_module
+ self.balloon.new_parent = self
+ self.speech.new_parent = self
+ self.extend_speech_balloon = if self.settings.blank?
+ {}
+ else
+ JSON.parse(self.settings)
+ end
+ self.balloon.extend_balloon = if self.balloon.settings.blank?
+ {}
+ else
+ JSON.parse(self.get_balloon.settings)
+ end
+ self.speech.extend_speech = if self.speech.settings.blank?
+ {}
+ else
+ JSON.parse(self.get_speech.settings)
+ end
+ end
+
+ 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 tag_element_type
+ 'speech_balloon'