class PaperTrailScrapbook::Chapter
Class Chapter
provides single version history analysis
@author Timothy Chambers <tim@hint.io>
Public Instance Methods
story()
click to toggle source
Single version historical analysis
@return [String] Human readable description of changes
# File lib/paper_trail_scrapbook/chapter.rb, line 19 def story updates = changes return unless tell_story?(updates) [preface, (updates unless destroy?)].compact.join("\n") end
Private Instance Methods
item_id()
click to toggle source
# File lib/paper_trail_scrapbook/chapter.rb, line 40 def item_id; end
preface()
click to toggle source
# File lib/paper_trail_scrapbook/chapter.rb, line 28 def preface "On #{whenn}, #{who} #{kind} #{what}".squeeze(' ') end
tell_story?(updates)
click to toggle source
# File lib/paper_trail_scrapbook/chapter.rb, line 42 def tell_story?(updates) create? || destroy? || updates.present? || !config.filter_non_changes end
what()
click to toggle source
# File lib/paper_trail_scrapbook/chapter.rb, line 32 def what if destroy? "#{model}#{item_id}" else "the following #{model}#{item_id} info:" end end