Class: Coopy::CompareFlags
- Inherits:
-
Object
- Object
- Coopy::CompareFlags
- Defined in:
- lib/coopy/compare_flags.rb
Instance Attribute Summary collapse
-
#acts ⇒ Object
Optional filters for actions, set any of: “update”, “insert”, “delete” to true to accept just those actions.
-
#always_show_header ⇒ Object
Should we always give a table header in diffs?.
-
#always_show_order ⇒ Object
Should we always decorate the diff with numerical indexes showing order?.
-
#never_show_order ⇒ Object
Should we never decorate the diff with numerical indexes?.
-
#ordered ⇒ Object
Should we treat the data as ordered?.
-
#show_unchanged ⇒ Object
Should we show unchanged rows in diffs?.
-
#show_unchanged_columns ⇒ Object
Should we show unchanged columns in diffs? (note that index/key columns needed to identify rows will be shown even if we turn this flag off).
-
#unchanged_column_context ⇒ Object
What is the minimum number of columns around a changed column that we should show?.
-
#unchanged_context ⇒ Object
What is the minimum number of rows around a changed row we should show?.
Instance Method Summary collapse
- #allow_delete ⇒ Object
- #allow_insert ⇒ Object
- #allow_update ⇒ Object
-
#initialize ⇒ CompareFlags
constructor
A new instance of CompareFlags.
Constructor Details
#initialize ⇒ CompareFlags
Returns a new instance of CompareFlags.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/coopy/compare_flags.rb', line 36 def initialize() @ordered = true; @show_unchanged = false; @unchanged_context = 1; @always_show_order = false; @never_show_order = true; @show_unchanged_columns = false; @unchanged_column_context = 1; @always_show_header = true; @acts = nil; end |
Instance Attribute Details
#acts ⇒ Object
Optional filters for actions, set any of:
"update", "insert", "delete"
to true to accept just those actions.
34 35 36 |
# File 'lib/coopy/compare_flags.rb', line 34 def acts @acts end |
#always_show_header ⇒ Object
Should we always give a table header in diffs?
29 30 31 |
# File 'lib/coopy/compare_flags.rb', line 29 def always_show_header @always_show_header end |
#always_show_order ⇒ Object
Should we always decorate the diff with numerical indexes showing order?
14 15 16 |
# File 'lib/coopy/compare_flags.rb', line 14 def always_show_order @always_show_order end |
#never_show_order ⇒ Object
Should we never decorate the diff with numerical indexes?
17 18 19 |
# File 'lib/coopy/compare_flags.rb', line 17 def never_show_order @never_show_order end |
#ordered ⇒ Object
Should we treat the data as ordered?
5 6 7 |
# File 'lib/coopy/compare_flags.rb', line 5 def ordered @ordered end |
#show_unchanged ⇒ Object
Should we show unchanged rows in diffs?
8 9 10 |
# File 'lib/coopy/compare_flags.rb', line 8 def show_unchanged @show_unchanged end |
#show_unchanged_columns ⇒ Object
Should we show unchanged columns in diffs? (note that index/key columns needed to identify rows will be shown even if we turn this flag off)
22 23 24 |
# File 'lib/coopy/compare_flags.rb', line 22 def show_unchanged_columns @show_unchanged_columns end |
#unchanged_column_context ⇒ Object
What is the minimum number of columns around a changed column that we should show?
26 27 28 |
# File 'lib/coopy/compare_flags.rb', line 26 def unchanged_column_context @unchanged_column_context end |
#unchanged_context ⇒ Object
What is the minimum number of rows around a changed row we should show?
11 12 13 |
# File 'lib/coopy/compare_flags.rb', line 11 def unchanged_context @unchanged_context end |
Instance Method Details
#allow_delete ⇒ Object
56 57 58 |
# File 'lib/coopy/compare_flags.rb', line 56 def allow_delete acts.nil? || acts.has_key?("delete") end |
#allow_insert ⇒ Object
52 53 54 |
# File 'lib/coopy/compare_flags.rb', line 52 def allow_insert acts.nil? || acts.has_key?("insert") end |
#allow_update ⇒ Object
48 49 50 |
# File 'lib/coopy/compare_flags.rb', line 48 def allow_update acts.nil? || acts.has_key?("update") end |