Exception: NaturalBornSlugger::IllegalOperationError
- Inherits:
-
NaturalBornError
- Object
- StandardError
- NaturalBornError
- NaturalBornSlugger::IllegalOperationError
- Defined in:
- lib/natural_born_slugger/exceptions.rb
Instance Method Summary collapse
-
#initialize(class_name, method_name, context = nil) ⇒ IllegalOperationError
constructor
A new instance of IllegalOperationError.
- #to_s ⇒ Object
Constructor Details
#initialize(class_name, method_name, context = nil) ⇒ IllegalOperationError
Returns a new instance of IllegalOperationError.
6 7 8 9 10 11 |
# File 'lib/natural_born_slugger/exceptions.rb', line 6 def initialize(class_name, method_name, context = nil) @class_name = class_name @method_name = method_name @context = context @message = "Cannot call `#{class_name}.#{method_name}" end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/natural_born_slugger/exceptions.rb', line 12 def to_s [@message, @context].compact.join(': ')+'.' end |