class Coopy::CompareFlags

Attributes

acts[RW]
allow_nested_cells[RW]
always_show_header[RW]
always_show_order[RW]
columns_to_ignore[RW]
count_like_a_spreadsheet[RW]
diff_strategy[RW]
ids[RW]
ignore_case[RW]
ignore_whitespace[RW]
never_show_order[RW]
ordered[RW]
padding_strategy[RW]
parent[RW]
show_meta[RW]
show_unchanged[RW]
show_unchanged_columns[RW]
show_unchanged_meta[RW]
tables[RW]
terminal_format[RW]
unchanged_column_context[RW]
unchanged_context[RW]
use_glyphs[RW]
warnings[RW]

Public Class Methods

new() click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 7
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
  @ids = nil
  @columns_to_ignore = nil
  @allow_nested_cells = false
  @warnings = nil
  @diff_strategy = nil
  @show_meta = true
  @show_unchanged_meta = false
  @tables = nil
  @parent = nil
  @count_like_a_spreadsheet = true
  @ignore_whitespace = false
  @ignore_case = false
  @terminal_format = nil
  @use_glyphs = true
end

Public Instance Methods

add_primary_key(column) click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 100
def add_primary_key(column)
  @ids = Array.new if @ids == nil
  @ids.push(column)
end
add_table(table) click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 110
def add_table(table)
  @tables = Array.new if @tables == nil
  @tables.push(table)
end
add_warning(warn) click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 115
def add_warning(warn)
  @warnings = Array.new if @warnings == nil
  @warnings.push(warn)
end
allow_delete() click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 80
def allow_delete 
  return true if @acts == nil
  @acts.include?("delete")
end
allow_insert() click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 75
def allow_insert 
  return true if @acts == nil
  @acts.include?("insert")
end
allow_update() click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 70
def allow_update 
  return true if @acts == nil
  @acts.include?("update")
end
filter(act,allow) click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 58
def filter(act,allow)
  if @acts == nil 
    @acts = {}
    @acts["update"] = !allow
    @acts["insert"] = !allow
    @acts["delete"] = !allow
  end
  return false if !@acts.include?(act)
  @acts[act] = allow
  true
end
get_ignored_columns() click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 85
def get_ignored_columns 
  return nil if @columns_to_ignore == nil
  ignore = {}
  begin
    _g1 = 0
    _g = @columns_to_ignore.length
    while(_g1 < _g) 
      i = _g1
      _g1+=1
      ignore[@columns_to_ignore[i]] = true
    end
  end
  ignore
end
get_warning() click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 120
def get_warning 
  @warnings.join("\n")
end
ignore_column(column) click to toggle source
# File lib/lib/coopy/compare_flags.rb, line 105
def ignore_column(column)
  @columns_to_ignore = Array.new if @columns_to_ignore == nil
  @columns_to_ignore.push(column)
end