Class: RQRCode::Export::SVG::Rect
- Inherits:
-
BaseOutputSVG
- Object
- BaseOutputSVG
- RQRCode::Export::SVG::Rect
- Defined in:
- lib/rqrcode/export/svg.rb
Instance Attribute Summary
Attributes inherited from BaseOutputSVG
Instance Method Summary collapse
Methods inherited from BaseOutputSVG
Constructor Details
This class inherits a constructor from RQRCode::Export::SVG::BaseOutputSVG
Instance Method Details
#build(module_size, offset, color) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/rqrcode/export/svg.rb', line 84 def build(module_size, offset, color) @qrcode.modules.each_index do |c| tmp = [] @qrcode.modules.each_index do |r| y = c * module_size + offset x = r * module_size + offset next unless @qrcode.checked?(c, r) tmp << %(<rect width="#{module_size}" height="#{module_size}" x="#{x}" y="#{y}" style="fill:##{color}"/>) end @result << tmp.join end end |