Module: FmRest::Spyke::Model::Connection

Extended by:
ActiveSupport::Concern
Included in:
FmRest::Spyke::Model
Defined in:
lib/fmrest/spyke/model/connection.rb

Class Method Summary collapse

Class Method Details

.connectionObject



29
30
31
# File 'lib/fmrest/spyke/model/connection.rb', line 29

def connection
  super || fmrest_connection
end

.faraday(&block) ⇒ Object

Sets a block for injecting custom middleware into the Faraday connection. Example usage:

class MyModel < FmRest::Spyke::Base
  faraday do |conn|
    # Set up a custom logger for the model
    conn.response :logger, MyApp.logger, bodies: true
  end
end


43
44
45
# File 'lib/fmrest/spyke/model/connection.rb', line 43

def faraday(&block)
  self.faraday_block = block
end