Module: Card::Action::Differ
- Included in:
- Card::Action
- Defined in:
- mod/history/lib/card/action/differ.rb
Overview
a collection of methods for comparing actions
Instance Method Summary collapse
-
#cardtype_diff(opts = {}) ⇒ rendered diff
compare action's cardtype value with previous cardtype value.
-
#content_diff(diff_type = :expanded, opts = nil) ⇒ rendered diff
compare action's content value with previous content value.
-
#green? ⇒ true/false
test whether content was visibly added.
-
#name_diff(opts = {}) ⇒ rendered diff
compare action's name value with previous name value.
-
#red? ⇒ true/false
test whether content was visibly removed.
Instance Method Details
#cardtype_diff(opts = {}) ⇒ rendered diff
compare action's cardtype value with previous cardtype value
14 15 16 17 |
# File 'mod/history/lib/card/action/differ.rb', line 14 def cardtype_diff opts={} return unless new_type? diff_object(:cardtype, opts).complete end |
#content_diff(diff_type = :expanded, opts = nil) ⇒ rendered diff
compare action's content value with previous content value
21 22 23 24 25 |
# File 'mod/history/lib/card/action/differ.rb', line 21 def content_diff diff_type=:expanded, opts=nil return unless new_content? dobj = content_diff_object(opts) diff_type == :summary ? dobj.summary : dobj.complete end |
#green? ⇒ true/false
test whether content was visibly added
35 36 37 |
# File 'mod/history/lib/card/action/differ.rb', line 35 def green? content_diff_object.green? end |
#name_diff(opts = {}) ⇒ rendered diff
compare action's name value with previous name value
7 8 9 10 |
# File 'mod/history/lib/card/action/differ.rb', line 7 def name_diff opts={} return unless new_name? diff_object(:name, opts).complete end |
#red? ⇒ true/false
test whether content was visibly removed
29 30 31 |
# File 'mod/history/lib/card/action/differ.rb', line 29 def red? content_diff_object.red? end |