Sha256: 90940188ab18e9ce0deda28ec7f74b0206f4a4f15c84dcd8e80b95b31f9e4cb3

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 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 :CachingStrategy,'marketo_api/middleware/caching_strategy'
    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

1 entries across 1 versions & 1 rubygems

Version Path
marketo_api-0.3.0.pre.alpha lib/marketo_api/middleware.rb