diff --git a/lib/gruff/renderer/dot.rb b/lib/gruff/renderer/dot.rb index f5609b54..737f90ff 100644 --- a/lib/gruff/renderer/dot.rb +++ b/lib/gruff/renderer/dot.rb @@ -5,7 +5,7 @@ module Gruff class Renderer::Dot def initialize(renderer, style, color:, width: 1.0, opacity: 1.0) @renderer = renderer - @style = style + @style = style.to_sym @color = color @width = width @opacity = opacity @@ -17,7 +17,7 @@ def render(new_x, new_y, radius) @renderer.draw.stroke(@color) @renderer.draw.fill_opacity(@opacity) @renderer.draw.fill(@color) - case @style.to_sym + case @style when :square square(new_x, new_y, radius) when :diamond @@ -28,6 +28,8 @@ def render(new_x, new_y, radius) @renderer.draw.pop end + private + def circle(new_x, new_y, radius) @renderer.draw.circle(new_x, new_y, new_x - radius, new_y) end