Module: Datadog::Contrib::Patchable::ClassMethods
- Defined in:
- lib/ddtrace/contrib/patchable.rb
Overview
Class methods for integrations
Instance Method Summary collapse
-
#available? ⇒ Boolean
Is the target available? (e.g. gem installed?).
-
#compatible? ⇒ Boolean
Is the loaded code compatible with this integration? (e.g. minimum version met?).
-
#loaded? ⇒ Boolean
Is the target loaded into the application? (e.g. constants defined?).
-
#patchable? ⇒ Boolean
Can the patch for this integration be applied?.
- #version ⇒ Object
Instance Method Details
#available? ⇒ Boolean
Is the target available? (e.g. gem installed?)
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?)
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?)
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?
33 34 35 |
# File 'lib/ddtrace/contrib/patchable.rb', line 33 def patchable? available? && loaded? && compatible? end |
#version ⇒ Object
13 14 15 |
# File 'lib/ddtrace/contrib/patchable.rb', line 13 def version nil end |