Class: Contact

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#bodyObject

Returns the value of attribute body.



6
7
8
# File 'app/models/contact.rb', line 6

def body
  @body
end

#emailObject

Returns the value of attribute email.



6
7
8
# File 'app/models/contact.rb', line 6

def email
  @email
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'app/models/contact.rb', line 6

def name
  @name
end

#subjectObject

Returns the value of attribute subject.



6
7
8
# File 'app/models/contact.rb', line 6

def subject
  @subject
end

Class Method Details

.display_nameObject



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

Returns:

  • (Boolean)


27
28
29
# File 'app/models/contact.rb', line 27

def persisted?
  false
end