Sha256: 8d1d250b2f1ded595b4165b52bcef70b65a4891bdacbff1a6b71f698a43bd524

Contents?: true

Size: 505 Bytes

Versions: 2

Compression:

Stored size: 505 Bytes

Contents

module Saddle::ClientAttributes

  def self.included(obj)
    obj.extend ClassMethods

    # Default values
    obj.additional_middlewares = []

    # We know that this module is included when saddle client is inherited,
    # so we're actually interested in the path of the caller two levels deep.
    path, = caller[2].partition(":")
    obj.implementation_root = File.dirname(path)
  end

  module ClassMethods
    attr_accessor :implementation_root
    attr_accessor :additional_middlewares
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
saddle-0.0.11 lib/saddle/client_attributes.rb
saddle-0.0.10 lib/saddle/client_attributes.rb