diff options
Diffstat (limited to 'new/lib/crys/processors/common_parts.rb')
-rw-r--r-- | new/lib/crys/processors/common_parts.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/new/lib/crys/processors/common_parts.rb b/new/lib/crys/processors/common_parts.rb new file mode 100644 index 0000000..1dbf6d8 --- /dev/null +++ b/new/lib/crys/processors/common_parts.rb @@ -0,0 +1,20 @@ +module Crys + module CommonParts + def webbutton(file:, url:, alt:) + full_path = image_dir + "/buttons/" + file + + image = ::Crys::ImageProcessor.new(path: full_path, filename: file, width: 88) + assets << image + + code = ERB.new <<-EOF +<a href="<%=url%>"> +<img src="<%=image.relative_path%>" width="88" height="31" class="webbutton" alt="<%=alt%>"> +</a> +EOF + + code.result(binding) + + end + + end +end |