circle_speech_balloon 0.0.51 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,9 @@
1
1
  module CircleSpeechBalloon
2
2
  class Balloon < ActiveRecord::Base
3
3
  # attr_accessible :title, :body
4
+
5
+ def supply_default
6
+ end
7
+
4
8
  end
5
9
  end
@@ -1,5 +1,9 @@
1
1
  module CircleSpeechBalloon
2
2
  class Speech < ActiveRecord::Base
3
3
  # attr_accessible :title, :body
4
+
5
+ def supply_default
6
+ end
7
+
4
8
  end
5
9
  end
@@ -1,5 +1,9 @@
1
1
  module CircleSpeechBalloon
2
2
  class SpeechBalloon < ActiveRecord::Base
3
3
  # attr_accessible :title, :body
4
+
5
+ def supply_default
6
+ end
7
+
4
8
  end
5
9
  end
@@ -3,33 +3,35 @@ require "circle_speech_balloon/engine"
3
3
  module CircleSpeechBalloon
4
4
  module SpeechBalloonModule
5
5
  def supply_default
6
- if self.speech_balloon_template
7
- self.classname = self.speech_balloon_template.classname
8
- self.settings = self.speech_balloon_template.parsed_settings['speech_balloon']
9
- end
10
- if self.panel
11
- self.t = self.panel.new_t
12
- self.z = self.panel.new_z
13
- end
6
+ super
7
+ self.speech_balloon_template_classname = self.speech_balloon_template.classname
14
8
  end
15
9
 
16
- def extend_speech_balloon
17
- @extend_speech_balloon ||= CircleSpeechBalloon::SpeechBalloon.new
10
+ def speech_balloon_extend
11
+ self.new_speech_balloon unless @speech_balloon_extend
12
+ @speech_balloon_extend
18
13
  end
19
14
 
20
- def extend_speech_balloon= params
21
- @extend_speech_balloon = CircleSpeechBalloon::SpeechBalloon.new params
15
+ def speech_balloon_extend= params
16
+ # load attributes
17
+ @speech_balloon_extend = CircleSpeechBalloon::SpeechBalloon.new params
18
+ # no supply default params
22
19
  end
23
20
 
24
- end
25
-
26
- module BalloonModule
21
+ def new_speech_balloon params = {}
22
+ @speech_balloon_extend = CircleSpeechBalloon::SpeechBalloon.new params
23
+ @speech_balloon_extend.supply_default
24
+ end
27
25
 
28
26
  def parsed_settings
29
- @parsed_settings ||= get_parent.speech_balloon_template.parsed_settings
27
+ @parsed_settings ||= self.speech_balloon_template.parsed_settings
30
28
  end
31
29
 
32
- def supply_default
30
+ end
31
+
32
+ module BalloonModule
33
+ def supply_default parsed_settings
34
+ s = self.parsed_settings['all']['balloon']
33
35
  self.x = 0
34
36
  self.y = 0
35
37
  self.width = self.parsed_settings['speech_balloon']['default_width']
@@ -37,12 +39,22 @@ module CircleSpeechBalloon
37
39
  self.r = self.parsed_settings['speech_balloon']['default_r']
38
40
  end
39
41
 
40
- def extend_balloon
41
- @extend_balloon ||= CircleSpeechBalloon::Balloon.new
42
+ def balloon_extend
43
+ self.new_balloon unless @balloon_extend
44
+ @balloon_extend ||= CircleSpeechBalloon::Balloon.new
45
+ end
46
+
47
+ def balloon_extend= params
48
+ @balloon_extend = CircleSpeechBalloon::Balloon.new params
42
49
  end
43
50
 
44
- def extend_balloon= params
45
- @extend_balloon = CircleSpeechBalloon::Balloon.new params
51
+ def new_sballoon params = {}
52
+ @balloon_extend = CircleSpeechBalloon::Balloon.new params
53
+ @balloon_extend.supply_default
54
+ end
55
+
56
+ def parsed_settings
57
+ @parsed_settings ||= self.speech_balloon_template.parsed_settings
46
58
  end
47
59
 
48
60
  def select_system_picture
@@ -58,19 +70,10 @@ module CircleSpeechBalloon
58
70
  @r_step ||= self.parsed_settings['speech_balloon']['r_step']
59
71
  end
60
72
 
61
- def classname
62
- get_parent.speech_balloon_template.classname
63
- end
64
-
65
73
  end
66
74
 
67
75
  module SpeechModule
68
-
69
- def parsed_settings
70
- @parsed_settings ||= get_parent.speech_balloon_template.parsed_settings
71
- end
72
-
73
- def supply_default
76
+ def supply_default parsed_settings
74
77
  s = self.parsed_settings['0']['speech']
75
78
  self.x = s['x_rate']
76
79
  self.y = s['y_rate']
@@ -82,12 +85,22 @@ module CircleSpeechBalloon
82
85
  self.fore_color = self.parsed_settings['speech_balloon']['default_fore_color']
83
86
  end
84
87
 
85
- def extend_speech
86
- @extend_speech ||= CircleSpeechBalloon::Speech.new
88
+ def speech_extend
89
+ self.new_speech unless @speech_extend
90
+ @speech_extend ||= CircleSpeechBalloon::Speech.new
91
+ end
92
+
93
+ def speech_extend= params
94
+ @speech_extend = CircleSpeechBalloon::Speech.new params
87
95
  end
88
96
 
89
- def extend_speech= params
90
- @extend_speech = CircleSpeechBalloon::Speech.new params
97
+ def new_speech params = {}
98
+ @speech_extend = CircleSpeechBalloon::Speech.new params
99
+ @speech_extend.supply_default
100
+ end
101
+
102
+ def parsed_settings
103
+ @parsed_settings ||= self.speech_balloon_template.parsed_settings
91
104
  end
92
105
 
93
106
  def arrayed_quotes
@@ -1,3 +1,3 @@
1
1
  module CircleSpeechBalloon
2
- VERSION = "0.0.51"
2
+ VERSION = "0.0.52"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circle_speech_balloon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.51
4
+ version: 0.0.52
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-11 00:00:00.000000000 Z
12
+ date: 2014-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3