Class: ConsistencyFail::Index
- Inherits:
-
Object
- Object
- ConsistencyFail::Index
- Defined in:
- lib/consistency_fail/index.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(model, table_name, columns) ⇒ Index
constructor
A new instance of Index.
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
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
3 4 5 |
# File 'lib/consistency_fail/index.rb', line 3 def columns @columns end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
3 4 5 |
# File 'lib/consistency_fail/index.rb', line 3 def model @model end |
#table_name ⇒ Object (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 |