Class: ContactUs
- Inherits:
-
Object
- Object
- ContactUs
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- lib/generators/pixelforce_cms/templates/contact_us.rb
Instance Attribute Summary collapse
-
#captcha ⇒ Object
Returns the value of attribute captcha.
-
#contact_number ⇒ Object
Returns the value of attribute contact_number.
-
#donate ⇒ Object
Returns the value of attribute donate.
-
#email ⇒ Object
Returns the value of attribute email.
-
#enquiry ⇒ Object
Returns the value of attribute enquiry.
-
#full_name ⇒ Object
Returns the value of attribute full_name.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ ContactUs
constructor
A new instance of ContactUs.
- #persisted? ⇒ Boolean
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ ContactUs
Returns a new instance of ContactUs.
10 11 12 13 14 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 10 def initialize(attributes = {}) attributes.each do |attr, value| self.send "#{attr}=", value end unless attributes.blank? end |
Instance Attribute Details
#captcha ⇒ Object
Returns the value of attribute captcha.
6 7 8 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6 def captcha @captcha end |
#contact_number ⇒ Object
Returns the value of attribute contact_number.
6 7 8 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6 def contact_number @contact_number end |
#donate ⇒ Object
Returns the value of attribute donate.
6 7 8 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6 def donate @donate end |
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6 def email @email end |
#enquiry ⇒ Object
Returns the value of attribute enquiry.
6 7 8 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6 def enquiry @enquiry end |
#full_name ⇒ Object
Returns the value of attribute full_name.
6 7 8 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6 def full_name @full_name end |
Instance Method Details
#persisted? ⇒ Boolean
16 17 18 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 16 def persisted? false end |
#save ⇒ Object
20 21 22 23 24 25 |
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 20 def save return if captcha.present? if valid? Notification.notify_us(self).deliver end end |