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?)
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?)
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?)
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?
32 33 34 |
# File 'lib/ddtrace/contrib/patchable.rb', line 32 def patchable? available? && loaded? && compatible? end |
#version ⇒ Object
12 13 14 |
# File 'lib/ddtrace/contrib/patchable.rb', line 12 def version nil end |