Class: RR::Integrations::Decorator
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- RR::Integrations::Decorator
- Defined in:
- lib/rr/integrations/decorator.rb
Instance Method Summary collapse
- #applies? ⇒ Boolean
-
#initialize(adapter) ⇒ Decorator
constructor
A new instance of Decorator.
- #load ⇒ Object
- #loaded? ⇒ Boolean
- #name ⇒ Object
Constructor Details
#initialize(adapter) ⇒ Decorator
Returns a new instance of Decorator.
6 7 8 9 |
# File 'lib/rr/integrations/decorator.rb', line 6 def initialize(adapter) super(adapter) @loaded = false end |
Instance Method Details
#applies? ⇒ Boolean
15 16 17 18 19 20 21 22 |
# File 'lib/rr/integrations/decorator.rb', line 15 def applies? __getobj__.applies? rescue => e if RR.debug? puts "#{__getobj__.class}#applies? failed: #{e.class} (#{e.})" puts e.backtrace.map {|x| " " + x }.join("\n") end end |
#load ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rr/integrations/decorator.rb', line 24 def load return if @loaded hook if RR.debug? puts "Loaded adapter: #{name}" end @loaded = true rescue => e if RR.debug? puts "Couldn't load adapter #{name}: #{e.class} (#{e.})" puts e.backtrace.map {|x| " " + x }.join("\n") end end |
#loaded? ⇒ Boolean
38 39 40 |
# File 'lib/rr/integrations/decorator.rb', line 38 def loaded? @loaded end |
#name ⇒ Object
11 12 13 |
# File 'lib/rr/integrations/decorator.rb', line 11 def name __getobj__.class.to_s.split('::').last.to_sym end |