Class: FeedbackPopup::Message

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Conversion, ActiveModel::Validations
Defined in:
app/models/feedback_popup/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Message

Returns a new instance of Message.



9
10
11
12
13
# File 'app/models/feedback_popup/message.rb', line 9

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

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



5
6
7
# File 'app/models/feedback_popup/message.rb', line 5

def body
  @body
end

Instance Method Details

#deliverObject



15
16
17
18
19
20
21
# File 'app/models/feedback_popup/message.rb', line 15

def deliver
  if self.valid?
    FeedbackPopup::Mailer.feedback(self).deliver
    return true
  end
  return false
end

#persisted?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/feedback_popup/message.rb', line 23

def persisted?
  false
end