Sha256: c7863c7328d8c47d5e5341b556138662cc0b28193c23e163c65a8702a89841f5
Contents?: true
Size: 721 Bytes
Versions: 18
Compression:
Stored size: 721 Bytes
Contents
module GridGenerator module Svg class Path def initialize(d: , style:) @d = case d when String d when Array d.map(&:to_s).join(' ') else raise ArgumentError, "d must be String or Array" end @style = case style when GridGenerator::Svg::Style style.to_s when String style else raise ArgumentError, "style must be String or Style" end end attr_reader :d, :style def to_svg "<path d=\"#{d}\" style=\"#{style}\" />" end end end end
Version data entries
18 entries across 18 versions & 1 rubygems