Exception: NaturalBornSlugger::ConfigurationError

Inherits:
NaturalBornError show all
Defined in:
lib/natural_born_slugger/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(class_name, attribute, context = nil) ⇒ ConfigurationError

Returns a new instance of ConfigurationError.



18
19
20
21
22
23
# File 'lib/natural_born_slugger/exceptions.rb', line 18

def initialize(class_name, attribute, context = nil)
  @class_name = class_name
  @attribute = attribute
  @context = context
  @message = "Composite attribute `#{attribute}` of #{class_name} has not been configured properly"
end

Instance Method Details

#to_sObject



24
25
26
# File 'lib/natural_born_slugger/exceptions.rb', line 24

def to_s
  [@message, @context].compact.join(': ')+'.'
end