Sha256: 44adb598b7663b9354ca8fc6d9cf66934dc30101ea5014f6120d81a86148fa9f

Contents?: true

Size: 351 Bytes

Versions: 47

Compression:

Stored size: 351 Bytes

Contents

module ApiClient

  module Mixins

    module Delegation

      def delegate(*methods)
        hash = methods.pop
        to = hash[:to]
        methods.each do |method|
          class_eval <<-STR
          def #{method}(*args, &block)
            #{to}.#{method}(*args, &block)
          end
          STR
        end
      end

    end

  end

end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
api_client-0.5.7 lib/api_client/mixins/delegation.rb
api_client-0.5.6 lib/api_client/mixins/delegation.rb
api_client-0.5.5 lib/api_client/mixins/delegation.rb
api_client-0.5.4 lib/api_client/mixins/delegation.rb
api_client-0.5.3 lib/api_client/mixins/delegation.rb
api_client-0.5.2 lib/api_client/mixins/delegation.rb
api_client-0.5.1 lib/api_client/mixins/delegation.rb
api_client-0.5.0 lib/api_client/mixins/delegation.rb
api_client-0.4.3 lib/api_client/mixins/delegation.rb
api_client-0.4.2 lib/api_client/mixins/delegation.rb
api_client-0.4.1 lib/api_client/mixins/delegation.rb
api_client-0.3.3 lib/api_client/mixins/delegation.rb
api_client-0.4.0 lib/api_client/mixins/delegation.rb
api_client-0.3.2 lib/api_client/mixins/delegation.rb
api_client-0.3.1 lib/api_client/mixins/delegation.rb
api_client-0.3.0 lib/api_client/mixins/delegation.rb
api_client-0.2.0 lib/api_client/mixins/delegation.rb
api_client-0.1.9 lib/api_client/mixins/delegation.rb
api_client-0.1.8 lib/api_client/mixins/delegation.rb
api_client-0.1.7 lib/api_client/mixins/delegation.rb