Exception: Holotype::Attribute::ReadOnlyError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ ReadOnlyError

Returns a new instance of ReadOnlyError.



6
7
8
# File 'lib/holotype/attribute/read_only_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/read_only_error.rb', line 4

def name
  @name
end

Instance Method Details

#messageObject



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

def message
  "Cannot modify read-only attribute `#{name}`".freeze
end