Class: Contact

Inherits:
Object show all
Includes:
ActiveModel::Validations
Defined in:
lib/cv/contact.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Contact

Returns a new instance of Contact.



9
10
11
# File 'lib/cv/contact.rb', line 9

def initialize(args = {})
  args.each { |key, value| send("#{key}=", value) }
end

Instance Attribute Details

#emailObject

Returns the value of attribute email.



4
5
6
# File 'lib/cv/contact.rb', line 4

def email
  @email
end

#messageObject

Returns the value of attribute message.



4
5
6
# File 'lib/cv/contact.rb', line 4

def message
  @message
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/cv/contact.rb', line 4

def name
  @name
end

Instance Method Details

#deliverObject



13
14
15
16
17
18
# File 'lib/cv/contact.rb', line 13

def deliver
  Mail.deliver :to => '[email protected]',
               :from => email,
               :subject => 'Contact',
               :body => message
end