Class: ActiveModel::NestedError
- Extended by:
- Forwardable
- Defined in:
- lib/active_model/nested_error.rb
Constant Summary
Constants inherited from Error
Error::CALLBACKS_OPTIONS, Error::MESSAGE_OPTIONS
Instance Attribute Summary collapse
-
#inner_error ⇒ Object
readonly
Returns the value of attribute inner_error.
Attributes inherited from Error
#attribute, #base, #options, #raw_type, #type
Instance Method Summary collapse
-
#initialize(base, inner_error, override_options = {}) ⇒ NestedError
constructor
A new instance of NestedError.
Methods inherited from Error
#==, #details, full_message, #full_message, generate_message, #hash, #initialize_dup, #inspect, #match?, #message, #strict_match?
Constructor Details
#initialize(base, inner_error, override_options = {}) ⇒ NestedError
Returns a new instance of NestedError.
8 9 10 11 12 13 14 15 |
# File 'lib/active_model/nested_error.rb', line 8 def initialize(base, inner_error, = {}) @base = base @inner_error = inner_error @attribute = .fetch(:attribute) { inner_error.attribute } @type = .fetch(:type) { inner_error.type } @raw_type = inner_error.raw_type @options = inner_error. end |
Instance Attribute Details
#inner_error ⇒ Object (readonly)
Returns the value of attribute inner_error.
17 18 19 |
# File 'lib/active_model/nested_error.rb', line 17 def inner_error @inner_error end |