Exception: MissingTableNameException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/custom_exceptions.rb

Overview

class to implement an exception for Missing Table Names in migrations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table_name) ⇒ MissingTableNameException

Returns a new instance of MissingTableNameException.


20
21
22
# File 'lib/custom_exceptions.rb', line 20

def initialize(table_name)
  @table_name = table_name
end

Instance Attribute Details

#table_nameObject (readonly)

Returns the value of attribute table_name


18
19
20
# File 'lib/custom_exceptions.rb', line 18

def table_name
  @table_name
end

Instance Method Details

#to_sObject


24
25
26
# File 'lib/custom_exceptions.rb', line 24

def to_s
  "#{I18n.t :missing_table_name}: #{table_name}"
end