Module: Spyke::ConnectionLambda::ClassMethods

Defined in:
lib/spyke/connection_lambda.rb

Instance Method Summary collapse

Instance Method Details

#connectionObject



20
21
22
23
24
25
26
27
28
# File 'lib/spyke/connection_lambda.rb', line 20

def connection
  return super unless connection_lambda?

  # lambda, Proc, and method are handled here
  return connection_lambda.call(super) unless connection_lambda.is_a?(Symbol)

  # symbol is turned into a method and called here.
  method(connection_lambda).call(super)
end