Class: ContactUs

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::Conversion, ActiveModel::Validations
Defined in:
lib/generators/pixelforce_cms/templates/contact_us.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#captchaObject

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_numberObject

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

Returns the value of attribute donate.



6
7
8
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6

def donate
  @donate
end

#emailObject

Returns the value of attribute email.



6
7
8
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 6

def email
  @email
end

#enquiryObject

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_nameObject

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

Returns:

  • (Boolean)


16
17
18
# File 'lib/generators/pixelforce_cms/templates/contact_us.rb', line 16

def persisted?
  false
end

#saveObject



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