Class: TBK::Webpay::Logger::BaseLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/tbk/webpay/logger/base_logger.rb

Overview

This is an abstract class that defines the required interface of a Webpay logger

Direct Known Subclasses

NullLogger, OfficialLogger

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ BaseLogger

Allow logger customization with a block



8
9
10
11
# File 'lib/tbk/webpay/logger/base_logger.rb', line 8

def initialize(&block)
  block.call(self) if block
  validate!
end

Instance Method Details

#confirmation(confirmation) ⇒ Object

Abstract method to log a payment confirmation

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/tbk/webpay/logger/base_logger.rb', line 19

def confirmation(confirmation)
  raise NotImplementedError, "TBK::Webpay::Logger::BaseLogger subclass must implement #confirmation method"
end

#payment(payment) ⇒ Object

Abstract method to log a payment

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/tbk/webpay/logger/base_logger.rb', line 14

def payment(payment)
  raise NotImplementedError, "TBK::Webpay::Logger::BaseLogger subclass must implement #payment method"
end