Sha256: c6503ac3a78a737b26b5398f825696e85431735efefe17a55110edf7836659d9

Contents?: true

Size: 523 Bytes

Versions: 3

Compression:

Stored size: 523 Bytes

Contents

require 'active_support/core_ext/string/inflections'
require 'rubyfox/client/java'

module Rubyfox
  module Client
    Requests = Java::Requests

    module Requests
      def self.[](*args)
        arg = args.shift
        case arg
        when Java::Requests::BaseRequest
          arg
        else
          name = arg.to_s.camelcase
          name += "Request" unless name.end_with?("Request")
          request_klass = Requests.__send__(name)
          request_klass.new(*args)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubyfox-client-0.2.0-java lib/rubyfox/client/requests.rb
rubyfox-client-0.1.0-java lib/rubyfox/client/requests.rb
rubyfox-client-0.0.1-java lib/rubyfox/client/requests.rb