Module: SquareSpeechBalloon::SpeechModule
- Defined in:
- lib/square_speech_balloon.rb
Instance Method Summary collapse
- #arrayed_quotes ⇒ Object
- #new_speech(params = {}) ⇒ Object
- #parsed_settings ⇒ Object
- #speech_extend ⇒ Object
- #speech_extend=(params) ⇒ Object
- #supply_default ⇒ Object
Instance Method Details
#arrayed_quotes ⇒ Object
99 100 101 |
# File 'lib/square_speech_balloon.rb', line 99 def arrayed_quotes @arrayed_quotes ||= (self.quotes.blank? ? self.parsed_settings['speech_balloon']['quotes'].to_s : self.quotes).split(/ /) end |
#new_speech(params = {}) ⇒ Object
90 91 92 93 |
# File 'lib/square_speech_balloon.rb', line 90 def new_speech params = {} @speech_extend = SquareSpeechBalloon::Speech.new params @speech_extend.supply_default end |
#parsed_settings ⇒ Object
95 96 97 |
# File 'lib/square_speech_balloon.rb', line 95 def parsed_settings @parsed_settings ||= self.speech_balloon_template.parsed_settings end |
#speech_extend ⇒ Object
81 82 83 84 |
# File 'lib/square_speech_balloon.rb', line 81 def speech_extend self.new_speech unless @speech_extend @speech_extend end |
#speech_extend=(params) ⇒ Object
86 87 88 |
# File 'lib/square_speech_balloon.rb', line 86 def speech_extend= params @speech_extend = SquareSpeechBalloon::Speech.new params end |
#supply_default ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/square_speech_balloon.rb', line 69 def supply_default s = self.parsed_settings['all']['speech'] self.x = s['x_rate'] self.y = s['y_rate'] self.width = s['width_rate'] self.height = s['height_rate'] self.quotes = '' self.font_size = self.parsed_settings['speech_balloon']['default_font_size'] self.text_align = self.parsed_settings['speech_balloon']['default_text_align'] self.fore_color = self.parsed_settings['speech_balloon']['default_fore_color'] end |