Class: Orchestra::Conductor::ServiceRecorder::Wrapper

Inherits:
Delegator
  • Object
show all
Defined in:
lib/orchestra/conductor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service, recording) ⇒ Wrapper

Returns a new instance of Wrapper.



97
98
99
100
# File 'lib/orchestra/conductor.rb', line 97

def initialize service, recording
  super service
  @recording = recording
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



106
107
108
109
110
111
112
113
114
# File 'lib/orchestra/conductor.rb', line 106

def method_missing meth, *args
  super.tap do |result|
    @recording << {
      :method => meth.to_s,
      :input  => args,
      :output => result,
    }
  end
end

Instance Attribute Details

#serviceObject Also known as: __getobj__

Returns the value of attribute service.



93
94
95
# File 'lib/orchestra/conductor.rb', line 93

def service
  @service
end

Instance Method Details

#inspectObject



116
117
118
# File 'lib/orchestra/conductor.rb', line 116

def inspect
  "#<#{self.class.name} service=#{service.inspect}>"
end

#kind_of?(klass) ⇒ Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/orchestra/conductor.rb', line 102

def kind_of? klass
  super or service.kind_of? klass
end