Class: Appsignal::Extension::MockTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/appsignal/extension.rb

Overview

Mock of the Transaction class. This mock is used when the extension cannot be loaded. This mock listens to all method calls and does nothing, and prevents NoMethodErrors from being raised.

Disabled in testing so we can make sure that we don’t miss an extension function implementation.

Instance Method Summary collapse

Constructor Details

#initialize(*_args) ⇒ MockTransaction

Returns a new instance of MockTransaction.



108
109
110
111
# File 'lib/appsignal/extension.rb', line 108

def initialize(*_args)
  # JRuby extension requirement, as it sends a pointer to the Transaction
  # object when creating it
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(_method, *_args, &_block) ⇒ Object



113
114
115
# File 'lib/appsignal/extension.rb', line 113

def method_missing(_method, *_args, &_block)
  super if Appsignal.testing?
end