Sha256: 28a6b7c3488b29e9b2f50880557fecd3f568a08aa3aaecf781fad3b2e44204f3

Contents?: true

Size: 600 Bytes

Versions: 2

Compression:

Stored size: 600 Bytes

Contents

require 'active_support/concern'
require_relative 'proxy'

module Backgrounded
  # mixin to add backgrounded proxy builder to all ruby objects
  module ObjectExtensions
    extend ActiveSupport::Concern

    # @param options (optional) options to pass into the backgrounded handler
    def backgrounded(options={})
      Backgrounded::Proxy.new self, options
    end

    class_methods do
      # @see Backgrounded::Concern#backgrounded
      def backgrounded(options={})
        Backgrounded::Proxy.new self, options
      end
    end
  end
end
Object.send(:include, Backgrounded::ObjectExtensions)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
backgrounded-2.1.2 lib/backgrounded/object_extensions.rb
backgrounded-2.1.1 lib/backgrounded/object_extensions.rb