Sha256: dc5455f2308e587c2343fcaa1b5073f457044e9c9329fde9b84d8a55296099ea

Contents?: true

Size: 726 Bytes

Versions: 41

Compression:

Stored size: 726 Bytes

Contents

module Cucumber
  module WireSupport
    class RequestHandler
      def initialize(connection)
        @connection = connection
        @message = underscore(self.class.name.split('::').last)
      end

      def execute(request_params = nil)
        @connection.call_remote(self, @message, request_params)
      end

      def handle_fail(params)
        raise @connection.exception(params)
      end

      def handle_success(params)
      end

      private

      # Props to Rails
      def underscore(camel_cased_word)
        camel_cased_word.to_s.gsub(/::/, '/').
        gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
        gsub(/([a-z\d])([A-Z])/,'\1_\2').
        tr("-", "_").
        downcase
      end
    end
  end
end

Version data entries

41 entries across 39 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/lib/cucumber/wire_support/request_handler.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/lib/cucumber/wire_support/request_handler.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/lib/cucumber/wire_support/request_handler.rb
cucumber-2.1.0 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.2 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.1 lib/cucumber/wire_support/request_handler.rb
cucumber-1.3.20 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.rc.5 lib/cucumber/wire_support/request_handler.rb
cucumber-1.3.19 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.rc.4 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.rc.3 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.rc.2 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.rc.1 lib/cucumber/wire_support/request_handler.rb
cucumber-1.3.18 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.beta.5 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.beta.4 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.beta.3 lib/cucumber/wire_support/request_handler.rb
cucumber-1.3.17 lib/cucumber/wire_support/request_handler.rb
cucumber-2.0.0.beta.2 lib/cucumber/wire_support/request_handler.rb