Class: AuditTables::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/audit_tables/base.rb

Direct Known Subclasses

ChangeAuditTable, CreateNewAuditTable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
# File 'lib/audit_tables/base.rb', line 6

def initialize(table_name)
  @table_name = table_name
  @audit_table_name = "audit_#{table_name}"
  @klass = table_name.classify.safe_constantize
end

Instance Attribute Details

#audit_table_nameObject

Returns the value of attribute audit_table_name.



4
5
6
# File 'lib/audit_tables/base.rb', line 4

def audit_table_name
  @audit_table_name
end

#columnObject

Returns the value of attribute column.



4
5
6
# File 'lib/audit_tables/base.rb', line 4

def column
  @column
end

#klassObject

Returns the value of attribute klass.



4
5
6
# File 'lib/audit_tables/base.rb', line 4

def klass
  @klass
end

#table_nameObject

Returns the value of attribute table_name.



4
5
6
# File 'lib/audit_tables/base.rb', line 4

def table_name
  @table_name
end