Class: AtPay::Button::Template
- Inherits:
-
Object
- Object
- AtPay::Button::Template
- Defined in:
- lib/atpay/button/template.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Template
constructor
Requires destination and email in addition to this, which should just be strings…
- #render(args = {}) ⇒ Object
Constructor Details
#initialize(options) ⇒ Template
Requires destination and email in addition to this, which should just be strings…
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/atpay/button/template.rb', line 8 def initialize() = { :subject => "Submit @Pay Payment", :title => "Pay", :background_color => "#6dbe45", :foreground_color => "#ffffff", :image => "https://www.atpay.com/wp-content/themes/atpay/images/bttn_cart.png", :processor => "[email protected]", :templates => File.join(File.dirname(__FILE__), "/templates"), :wrap => false, :wrap_text => "Made for Mobile" }.update() end |
Instance Method Details
#render(args = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/atpay/button/template.rb', line 22 def render(args={}) .update args template.render({ 'url' => default_mailto, 'outlook_url' => outlook_mailto, 'yahoo_url' => yahoo_mailto, 'content' => amount, 'dollar' => amount.match(/\$\d+(?=\.)/).to_s, 'cents' => amount.match(/(?<=\.)[^.]*/).to_s, }.update(string_hash )) end |