Class: C2eCore::Drops::InvoicePromoDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/invoice_promo_drop.rb
Instance Method Summary collapse
-
#description ⇒ String?
-
Description in the Order Language or CompanyBranch’s default language.
-
-
#initialize(invoice_promo) ⇒ InvoicePromoDrop
constructor
A new instance of InvoicePromoDrop.
-
#qr_code ⇒ String?
-
QR code as a data URL, e.g.:
"data:image/png;base64,iVBO..."
, with a width of 400px.
-
Constructor Details
#initialize(invoice_promo) ⇒ InvoicePromoDrop
Returns a new instance of InvoicePromoDrop.
6 7 8 9 |
# File '/build/app/mailers/c2e_core/drops/invoice_promo_drop.rb', line 6 def initialize(invoice_promo) super() @invoice_promo = invoice_promo end |
Instance Method Details
#description ⇒ String?
-
Description in the Order Language or CompanyBranch’s default language.
null
is
returned when description is not configured.
24 25 26 |
# File '/build/app/mailers/c2e_core/drops/invoice_promo_drop.rb', line 24 def description @invoice_promo[:description] end |
#qr_code ⇒ String?
Returns - QR code as a data URL, e.g.: "data:image/png;base64,iVBO..."
, with a width of 400px. null
is returned when QR code link is not configured.
13 14 15 16 17 18 19 20 |
# File '/build/app/mailers/c2e_core/drops/invoice_promo_drop.rb', line 13 def qr_code return unless @invoice_promo[:qr_code_url].present? RQRCode::QRCode .new(@invoice_promo[:qr_code_url]) .as_png(size: 400, border_modules: 0) .to_data_url end |