Class: ConsistencyFail::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/consistency_fail/index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, table_name, columns) ⇒ Index

Returns a new instance of Index.



4
5
6
7
8
# File 'lib/consistency_fail/index.rb', line 4

def initialize(model, table_name, columns)
  @model = model
  @table_name = table_name
  @columns = columns.map(&:to_s)
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



3
4
5
# File 'lib/consistency_fail/index.rb', line 3

def columns
  @columns
end

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/consistency_fail/index.rb', line 3

def model
  @model
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



3
4
5
# File 'lib/consistency_fail/index.rb', line 3

def table_name
  @table_name
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
13
# File 'lib/consistency_fail/index.rb', line 10

def ==(other)
  self.table_name == other.table_name &&
    self.columns.sort == other.columns.sort
end