Class: Spree::ContactUs::Contact
- Inherits:
-
Object
- Object
- Spree::ContactUs::Contact
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- app/models/spree/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.
16 17 18 19 20 |
# File 'app/models/spree/contact_us/contact.rb', line 16 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.
8 9 10 |
# File 'app/models/spree/contact_us/contact.rb', line 8 def email @email end |
#message ⇒ Object
Returns the value of attribute message.
8 9 10 |
# File 'app/models/spree/contact_us/contact.rb', line 8 def @message end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'app/models/spree/contact_us/contact.rb', line 8 def name @name end |
#subject ⇒ Object
Returns the value of attribute subject.
8 9 10 |
# File 'app/models/spree/contact_us/contact.rb', line 8 def subject @subject end |
Instance Method Details
#persisted? ⇒ Boolean
30 31 32 |
# File 'app/models/spree/contact_us/contact.rb', line 30 def persisted? false end |
#save ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/models/spree/contact_us/contact.rb', line 22 def save if self.valid? Spree::ContactUs::ContactMailer.contact_email(self).deliver return true end return false end |