Module: Datadog::Contrib::Patchable::ClassMethods

Defined in:
lib/ddtrace/contrib/patchable.rb

Overview

Class methods for integrations

Instance Method Summary collapse

Instance Method Details

#available?Boolean

Is the target available? (e.g. gem installed?)

Returns:

  • (Boolean)


17
18
19
# File 'lib/ddtrace/contrib/patchable.rb', line 17

def available?
  !version.nil?
end

#compatible?Boolean

Is the loaded code compatible with this integration? (e.g. minimum version met?)

Returns:

  • (Boolean)


27
28
29
# File 'lib/ddtrace/contrib/patchable.rb', line 27

def compatible?
  available? && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(VERSION::MINIMUM_RUBY_VERSION)
end

#loaded?Boolean

Is the target loaded into the application? (e.g. constants defined?)

Returns:

  • (Boolean)


22
23
24
# File 'lib/ddtrace/contrib/patchable.rb', line 22

def loaded?
  true
end

#patchable?Boolean

Can the patch for this integration be applied?

Returns:

  • (Boolean)


32
33
34
# File 'lib/ddtrace/contrib/patchable.rb', line 32

def patchable?
  available? && loaded? && compatible?
end

#versionObject



12
13
14
# File 'lib/ddtrace/contrib/patchable.rb', line 12

def version
  nil
end