Class: Coopy::CompareFlags

Inherits:
Object
  • Object
show all
Defined in:
lib/coopy/compare_flags.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCompareFlags

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

#actsObject

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_headerObject

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_orderObject

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_orderObject

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

#orderedObject

Should we treat the data as ordered?



5
6
7
# File 'lib/coopy/compare_flags.rb', line 5

def ordered
  @ordered
end

#show_unchangedObject

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_columnsObject

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_contextObject

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_contextObject

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_deleteObject



56
57
58
# File 'lib/coopy/compare_flags.rb', line 56

def allow_delete
  acts.nil? || acts.has_key?("delete")
end

#allow_insertObject



52
53
54
# File 'lib/coopy/compare_flags.rb', line 52

def allow_insert
  acts.nil? || acts.has_key?("insert")
end

#allow_updateObject



48
49
50
# File 'lib/coopy/compare_flags.rb', line 48

def allow_update
  acts.nil? || acts.has_key?("update")
end