Class: ActsAsMentionable::MentionsUpdater
- Inherits:
-
Object
- Object
- ActsAsMentionable::MentionsUpdater
- Defined in:
- lib/acts_as_mentionable/mentions_updater.rb
Instance Attribute Summary collapse
-
#changes ⇒ Object
readonly
Returns the value of attribute changes.
-
#mentioner ⇒ Object
readonly
Returns the value of attribute mentioner.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(mentioner, changes) ⇒ MentionsUpdater
constructor
A new instance of MentionsUpdater.
Constructor Details
#initialize(mentioner, changes) ⇒ MentionsUpdater
Returns a new instance of MentionsUpdater.
5 6 7 8 |
# File 'lib/acts_as_mentionable/mentions_updater.rb', line 5 def initialize mentioner, changes @mentioner = mentioner @changes = changes end |
Instance Attribute Details
#changes ⇒ Object (readonly)
Returns the value of attribute changes.
3 4 5 |
# File 'lib/acts_as_mentionable/mentions_updater.rb', line 3 def changes @changes end |
#mentioner ⇒ Object (readonly)
Returns the value of attribute mentioner.
3 4 5 |
# File 'lib/acts_as_mentionable/mentions_updater.rb', line 3 def mentioner @mentioner end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/acts_as_mentionable/mentions_updater.rb', line 10 def call Mention.transaction do remove_old_mentionables add_new_mentionables invoke_mentions_updated_callback yield if block_given? end end |