Class: ContactUs::Contact
- Inherits:
-
Object
- Object
- ContactUs::Contact
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- app/models/contact_us/contact.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#message ⇒ Object
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Contact
constructor
A new instance of Contact.
- #persisted? ⇒ Boolean
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Contact
Returns a new instance of Contact.
13 14 15 16 17 |
# File 'app/models/contact_us/contact.rb', line 13 def initialize(attributes = {}) attributes.each do |key, value| self.send("#{key}=", value) end end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'app/models/contact_us/contact.rb', line 5 def email @email end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'app/models/contact_us/contact.rb', line 5 def @message end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'app/models/contact_us/contact.rb', line 5 def name @name end |
#subject ⇒ Object
Returns the value of attribute subject.
5 6 7 |
# File 'app/models/contact_us/contact.rb', line 5 def subject @subject end |
Instance Method Details
#persisted? ⇒ Boolean
27 28 29 |
# File 'app/models/contact_us/contact.rb', line 27 def persisted? false end |
#save ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/models/contact_us/contact.rb', line 19 def save if self.valid? ContactUs::ContactMailer.contact_email(self).deliver_now return true end return false end |