Class: Aux::Validations::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/aux/validations/error.rb

Overview

Describes a single validation error

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, scope, type, **details) ⇒ Error

Returns a new instance of Error.

Parameters:

  • attribute (Symbol)
  • scope (String)
  • type (Symbol)
  • details (Hash)


21
22
23
24
25
26
# File 'lib/aux/validations/error.rb', line 21

def initialize(attribute, scope, type, **details)
  @attribute = attribute
  @scope = scope
  @type = type
  @details = details
end

Instance Attribute Details

#attributeSymbol (readonly)

Returns:

  • (Symbol)


15
16
17
# File 'lib/aux/validations/error.rb', line 15

def attribute
  @attribute
end

#detailsObject (readonly)

Returns the value of attribute details.



15
# File 'lib/aux/validations/error.rb', line 15

attr_reader :attribute, :scope, :type, :details

#scopeString (readonly)

Returns:

  • (String)


15
# File 'lib/aux/validations/error.rb', line 15

attr_reader :attribute, :scope, :type, :details

#typeSymbol (readonly)

Returns:

  • (Symbol)


15
# File 'lib/aux/validations/error.rb', line 15

attr_reader :attribute, :scope, :type, :details