Sha256: 0ff2943bdb77c8ff52ce4e986e5a0db90204b557d33f439539a1216c6f246189

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

module MarketoApi
  # Base class that all middleware can extend. Provides some convenient helper
  # functions.
  class Middleware < Faraday::Middleware
    autoload :RaiseError,     'marketo_api/middleware/raise_error'
    autoload :Authentication, 'marketo_api/middleware/authentication'
    autoload :Authorization,  'marketo_api/middleware/authorization'
    autoload :Caching,        'marketo_api/middleware/caching'
    autoload :Logger,         'marketo_api/middleware/logger'

    def initialize(app, client, options)
      @app = app
      @client = client
      @options = options
    end

    # Internal: Proxy to the client.
    def client
      @client
    end

    # Internal: Proxy to the client's faraday connection.
    def connection
      client.send(:connection)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
marketo_api-0.1.1.pre.alpha lib/marketo_api/middleware.rb
marketo_api-0.0.7.pre.alpha lib/marketo_api/middleware.rb