Class: Strict::AssignmentError

Inherits:
Error
  • Object
show all
Defined in:
lib/strict/assignment_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(assignable_class:, invalid_attribute:, value:) ⇒ AssignmentError

Returns a new instance of AssignmentError.



7
8
9
10
11
12
# File 'lib/strict/assignment_error.rb', line 7

def initialize(assignable_class:, invalid_attribute:, value:)
  super(message_from(assignable_class: assignable_class, invalid_attribute: invalid_attribute, value: value))

  @invalid_attribute = invalid_attribute
  @value = value
end

Instance Attribute Details

#invalid_attributeObject (readonly)

Returns the value of attribute invalid_attribute.



5
6
7
# File 'lib/strict/assignment_error.rb', line 5

def invalid_attribute
  @invalid_attribute
end

#valueObject (readonly)

Returns the value of attribute value.



5
6
7
# File 'lib/strict/assignment_error.rb', line 5

def value
  @value
end