Exception: Usps::Imis::Errors::PanelUnimplementedError

Inherits:
Usps::Imis::Error show all
Defined in:
lib/usps/imis/errors/panel_unimplemented_error.rb

Overview

Exception raised when a panel is missing required method definitions

Instance Attribute Summary

Attributes inherited from Usps::Imis::Error

#metadata

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Usps::Imis::Error

#bugsnag_meta_data

Constructor Details

#initialize(class_name, method, metadata = {}) ⇒ PanelUnimplementedError

Create a new instance of PanelUnimplementedError

Parameters:

  • class_name (String)

    Name of the Panel class that is missing a method definition

  • method (String)

    Method definition that is not defined on the Panel

  • metadata (Hash) (defaults to: {})

    Additional call-specific metadata to pass through to Bugsnag



22
23
24
25
26
# File 'lib/usps/imis/errors/panel_unimplemented_error.rb', line 22

def initialize(class_name, method,  = {})
  @class_name = class_name
  @method = method
  super(message, )
end

Class Method Details

.from(class_name, method) ⇒ Object

Create a new instance of PanelUnimplementedError from the class name and missing method

Parameters:

  • class_name (String)

    Name of the Panel class that is missing a method definition

  • method (String)

    Method definition that is not defined on the Panel



14
# File 'lib/usps/imis/errors/panel_unimplemented_error.rb', line 14

def self.from(class_name, method) = new(class_name, method)

Instance Method Details

#messageObject

Exception message including the undefined method



30
# File 'lib/usps/imis/errors/panel_unimplemented_error.rb', line 30

def message = "#{@class_name} must implement ##{@method}"