Exception: ImmutableAttributeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/puppet/external/event-loop/better-definers.rb

Instance Method Summary collapse

Constructor Details

#initialize(attribute = nil, message = nil) ⇒ ImmutableAttributeError

Returns a new instance of ImmutableAttributeError.



198
199
200
201
# File 'lib/puppet/external/event-loop/better-definers.rb', line 198

def initialize (attribute=nil, message=nil)
  super message
  @attribute = attribute
end

Instance Method Details

#to_sObject



205
206
207
208
209
210
211
212
213
214
215
# File 'lib/puppet/external/event-loop/better-definers.rb', line 205

def to_s
  if @attribute and @message
    "cannot change the value of `#@attribute': #@message"
  elsif @attribute
    "cannot change the value of `#@attribute'"
  elsif @message
    "cannot change the value of attribute: #@message"
  else
    "cannot change the value of attribute"
  end
end