Example of svg id being supplied, better input handling of svg ids
This commit is contained in:
@@ -30,6 +30,7 @@ module Squib
|
||||
def svg(range: :all, file: nil, id: nil, x: 0, y: 0, width: :native, height: :native)
|
||||
range = rangeify(range)
|
||||
file = fileify(file)
|
||||
id = idify(id)
|
||||
range.each{ |i| @cards[i].svg(file, id, x, y, width, height) }
|
||||
end
|
||||
|
||||
|
||||
@@ -58,6 +58,14 @@ module Squib
|
||||
end
|
||||
module_function :radiusify
|
||||
|
||||
def idify(svgid)
|
||||
unless svgid.nil?
|
||||
svgid = '#' << svgid unless svgid.start_with? '#'
|
||||
end
|
||||
svgid
|
||||
end
|
||||
module_function :idify
|
||||
|
||||
def xyify
|
||||
#TODO: Allow negative numbers that subtract from the card width & height
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user