Exception: Holotype::Attribute::FrozenModificationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/holotype/attribute/frozen_modification_error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute_name) ⇒ FrozenModificationError

Returns a new instance of FrozenModificationError.



6
7
8
# File 'lib/holotype/attribute/frozen_modification_error.rb', line 6

def initialize attribute_name
  @attribute_name = attribute_name.freeze
end

Instance Attribute Details

#attribute_nameObject (readonly)

Returns the value of attribute attribute_name.



4
5
6
# File 'lib/holotype/attribute/frozen_modification_error.rb', line 4

def attribute_name
  @attribute_name
end

Instance Method Details

#messageObject



10
11
12
# File 'lib/holotype/attribute/frozen_modification_error.rb', line 10

def message
  "Cannot modify value of `#{attribute_name}` in frozen object".freeze
end