File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
class ChartsPresenter
2
2
3
- CHART_TYPES = %w[ bar bubble doughnut horizontal_bar line pie polar_area radar scatter ]
3
+ CHART_TYPES = %w[ bar bubble doughnut horizontal_bar line pie polar_area radar scatter ] . freeze
4
4
5
5
class << self
6
6
private
@@ -29,7 +29,7 @@ def to_html
29
29
private
30
30
31
31
def to_js
32
- <<-END . squish . html_safe
32
+ <<-JSBLOCK . squish . html_safe
33
33
(function() {
34
34
var initChart = function() {
35
35
var ctx = document.getElementById(#{ @element_id . to_json } );
@@ -53,7 +53,7 @@ def to_js
53
53
}
54
54
}
55
55
})();
56
- END
56
+ JSBLOCK
57
57
end
58
58
59
59
def canvas
@@ -81,7 +81,7 @@ def to_javascript_string(element)
81
81
end
82
82
'[' + array_elements . join ( ',' ) + ']'
83
83
when String
84
- if element . match ( /^\s *function.*}\s *$/m )
84
+ if element =~ /^\s *function.*}\s *$/m
85
85
# Raw-copy function definitions to the output without surrounding quotes.
86
86
element
87
87
else
You can’t perform that action at this time.
0 commit comments