Class: Bcash::Payment
- Inherits:
-
Object
- Object
- Bcash::Payment
- Includes:
- ActionView::Helpers::TagHelper, ActiveModel::Validations
- Defined in:
- lib/bcash/payment.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#options ⇒ Object
Returns the value of attribute options.
-
#package ⇒ Object
Returns the value of attribute package.
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(package, options = {}) ⇒ Payment
constructor
A new instance of Payment.
Constructor Details
#initialize(package, options = {}) ⇒ Payment
Returns a new instance of Payment.
11 12 13 14 15 |
# File 'lib/bcash/payment.rb', line 11 def initialize(package, = {}) @package = package @options = @email = @options[:email_loja] end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
7 8 9 |
# File 'lib/bcash/payment.rb', line 7 def email @email end |
#options ⇒ Object
Returns the value of attribute options.
6 7 8 |
# File 'lib/bcash/payment.rb', line 6 def @options end |
#package ⇒ Object
Returns the value of attribute package.
6 7 8 |
# File 'lib/bcash/payment.rb', line 6 def package @package end |
Instance Method Details
#html ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bcash/payment.rb', line 17 def html form_content = File.open(File.join(File.dirname(__FILE__), 'form_bcash.html.haml')).read if block_given? = yield else = content_tag('button', 'Pagar com Bcash!', type: "submit") end Haml::Engine.new(form_content).render(nil, package: self.package, options: self., button_html: ) end |