Class: OgoneRails::Form
- Inherits:
-
Object
- Object
- OgoneRails::Form
- Defined in:
- lib/ogone-rails/form.rb
Instance Attribute Summary collapse
-
#form_fields ⇒ Object
readonly
Returns the value of attribute form_fields.
-
#form_tag ⇒ Object
readonly
Returns the value of attribute form_tag.
Instance Method Summary collapse
- #add_input(name, value) ⇒ Object
- #get_form_tag(action = "", options = {}) ⇒ Object
-
#initialize ⇒ Form
constructor
A new instance of Form.
Constructor Details
#initialize ⇒ Form
Returns a new instance of Form.
6 7 8 |
# File 'lib/ogone-rails/form.rb', line 6 def initialize @form_fields = {} end |
Instance Attribute Details
#form_fields ⇒ Object (readonly)
Returns the value of attribute form_fields.
4 5 6 |
# File 'lib/ogone-rails/form.rb', line 4 def form_fields @form_fields end |
#form_tag ⇒ Object (readonly)
Returns the value of attribute form_tag.
4 5 6 |
# File 'lib/ogone-rails/form.rb', line 4 def form_tag @form_tag end |
Instance Method Details
#add_input(name, value) ⇒ Object
20 21 22 |
# File 'lib/ogone-rails/form.rb', line 20 def add_input name, value @form_fields[name] = value end |
#get_form_tag(action = "", options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/ogone-rails/form.rb', line 10 def get_form_tag action = "", = {} # parse form atributes form_attributes = "" .each do |key, value| form_attributes << "#{key}=\"#{value}\" " end @form_tag = "<form method='post' action='#{action}' #{ form_attributes }>\n" end |