Class: Contact
- Inherits:
-
Object
- Object
- Contact
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- app/models/contact.rb
Constant Summary collapse
- VALID_EMAIL_REGEX =
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#subject ⇒ Object
Returns the value of attribute subject.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Contact
constructor
A new instance of Contact.
- #persisted? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Contact
Returns a new instance of Contact.
13 14 15 16 17 |
# File 'app/models/contact.rb', line 13 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'app/models/contact.rb', line 6 def body @body end |
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'app/models/contact.rb', line 6 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'app/models/contact.rb', line 6 def name @name end |
#subject ⇒ Object
Returns the value of attribute subject.
6 7 8 |
# File 'app/models/contact.rb', line 6 def subject @subject end |
Class Method Details
.display_name ⇒ Object
19 20 21 |
# File 'app/models/contact.rb', line 19 def self.display_name 'Correo' end |
.get_attribute_label(label) ⇒ Object
23 24 25 |
# File 'app/models/contact.rb', line 23 def self.get_attribute_label(label) return label end |
Instance Method Details
#persisted? ⇒ Boolean
27 28 29 |
# File 'app/models/contact.rb', line 27 def persisted? false end |