Sha256: 47a2899bf0ffb164d7e6d081b44dac2d14feeecccdfce886d499527274d88f48

Contents?: true

Size: 646 Bytes

Versions: 37

Compression:

Stored size: 646 Bytes

Contents

module Rasti
  class App
    module Delegable

      def methods(*args)
        delegated_methods | super
      end

      def public_methods(*args)
        delegated_methods | super
      end

      private

      def delegated_method?(method_name)
        delegated_methods.include? method_name.to_sym
      end

      def method_missing(method_name, *args, &block)
        if delegated_method? method_name
          call_delegated_method method_name, *args, &block
        else
          super
        end
      end

      def respond_to_missing?(method_name, *args)
        delegated_method?(method_name) || super
      end

    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
rasti-app-11.0.0 lib/rasti/app/delegable.rb
rasti-app-10.0.1 lib/rasti/app/delegable.rb
rasti-app-10.0.0 lib/rasti/app/delegable.rb
rasti-app-9.0.0 lib/rasti/app/delegable.rb
rasti-app-8.0.1 lib/rasti/app/delegable.rb
rasti-app-8.0.0 lib/rasti/app/delegable.rb
rasti-app-7.1.1 lib/rasti/app/delegable.rb
rasti-app-7.1.0 lib/rasti/app/delegable.rb
rasti-app-7.0.2 lib/rasti/app/delegable.rb
rasti-app-7.0.1 lib/rasti/app/delegable.rb
rasti-app-7.0.0 lib/rasti/app/delegable.rb
rasti-app-6.0.1 lib/rasti/app/delegable.rb
rasti-app-6.0.0 lib/rasti/app/delegable.rb
rasti-app-5.0.0 lib/rasti/app/delegable.rb
rasti-app-4.0.2 lib/rasti/app/delegable.rb
rasti-app-4.0.1 lib/rasti/app/delegable.rb
rasti-app-4.0.0 lib/rasti/app/delegable.rb
rasti-app-3.0.0 lib/rasti/app/delegable.rb
rasti-app-2.2.4 lib/rasti/app/delegable.rb
rasti-app-2.2.3 lib/rasti/app/delegable.rb