Class: Rcms::Feedback
- Inherits:
-
Object
- Object
- Rcms::Feedback
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations
- Defined in:
- lib/generators/templates_feedback/app/models/rcms/feedback.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#feedback_type ⇒ Object
Returns the value of attribute feedback_type.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#text ⇒ Object
Returns the value of attribute text.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Feedback
constructor
A new instance of Feedback.
- #persisted? ⇒ Boolean
- #subject ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Feedback
Returns a new instance of Feedback.
18 19 20 21 22 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 18 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) end end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 10 def email @email end |
#feedback_type ⇒ Object
Returns the value of attribute feedback_type.
7 8 9 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 7 def feedback_type @feedback_type end |
#phone ⇒ Object
Returns the value of attribute phone.
8 9 10 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 8 def phone @phone end |
#text ⇒ Object
Returns the value of attribute text.
9 10 11 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 9 def text @text end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 6 def username @username end |
Instance Method Details
#persisted? ⇒ Boolean
24 25 26 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 24 def persisted? false end |
#subject ⇒ Object
14 15 16 |
# File 'lib/generators/templates_feedback/app/models/rcms/feedback.rb', line 14 def subject I18n.t('rcms.feedback.subject', contact: (phone||email)) end |