Exception: Holotype::Attribute::ImmutableValueError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ImmutableValueError

Returns a new instance of ImmutableValueError.



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

def initialize name
  @name = name.freeze
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#messageObject



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

def message
  "Cannot modify value of `#{name}` in immutable class".freeze
end