Exception: Mv::Core::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/mv/core/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Error

Returns a new instance of Error.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/mv/core/error.rb', line 6

def initialize(opts = {})
  opts = opts.with_indifferent_access

  @table_name = opts[:table_name]
  @column_name = opts[:column_name]
  @validation_type = opts[:validation_type]
  @options = opts[:options]
  @error = opts[:error]

  super [
    @table_name ? "table: '#{@table_name}'" : nil,
    @column_name ? "column: '#{@column_name}'" : nil, 
    @validation_type ? "validation: '#{@validation_type}'" : nil, 
    @options ? "options: '#{@options}'" : nil, 
    @error ? "error: '#{@error}'" : nil, 
  ].compact.join(', ')
end

Instance Attribute Details

#column_nameObject (readonly)

Returns the value of attribute column_name.



4
5
6
# File 'lib/mv/core/error.rb', line 4

def column_name
  @column_name
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/mv/core/error.rb', line 4

def error
  @error
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/mv/core/error.rb', line 4

def options
  @options
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



4
5
6
# File 'lib/mv/core/error.rb', line 4

def table_name
  @table_name
end

#validation_typeObject (readonly)

Returns the value of attribute validation_type.



4
5
6
# File 'lib/mv/core/error.rb', line 4

def validation_type
  @validation_type
end