Class: Incline::ContactMessage

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, ActiveModel::Validations
Defined in:
app/models/incline/contact_message.rb

Overview

Defines the message generated by the generic contact form.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



8
9
10
# File 'app/models/incline/contact_message.rb', line 8

def body
  @body
end

#recaptchaObject

Returns the value of attribute recaptcha.



8
9
10
# File 'app/models/incline/contact_message.rb', line 8

def recaptcha
  @recaptcha
end

Returns the value of attribute related_to.



8
9
10
# File 'app/models/incline/contact_message.rb', line 8

def related_to
  @related_to
end

#remote_ipObject

Returns the value of attribute remote_ip.



8
9
10
# File 'app/models/incline/contact_message.rb', line 8

def remote_ip
  @remote_ip
end

#subjectObject

Returns the value of attribute subject.



8
9
10
# File 'app/models/incline/contact_message.rb', line 8

def subject
  @subject
end

#your_emailObject

Returns the value of attribute your_email.



8
9
10
# File 'app/models/incline/contact_message.rb', line 8

def your_email
  @your_email
end

#your_nameObject

Returns the value of attribute your_name.



8
9
10
# File 'app/models/incline/contact_message.rb', line 8

def your_name
  @your_name
end

Instance Method Details

#full_subjectObject

Gets the full subject for the message.



19
20
21
22
# File 'app/models/incline/contact_message.rb', line 19

def full_subject
  return related_to if subject.blank?
  "#{related_to}: #{subject}"
end

#send_messageObject

Sends the message.



26
27
28
# File 'app/models/incline/contact_message.rb', line 26

def send_message
  Incline::ContactForm.contact(self).deliver_now
end