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)


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

def available?
  !version.nil?
end

#compatible?Boolean

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

Returns:

  • (Boolean)


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

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)


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

def loaded?
  true
end

#patchable?Boolean

Can the patch for this integration be applied?

Returns:

  • (Boolean)


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

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

#versionObject



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

def version
  nil
end