Sha256: 811626b0941a1670bc20849daba66a7046f24203c0f157d3401022f82646866c

Contents?: true

Size: 648 Bytes

Versions: 22

Compression:

Stored size: 648 Bytes

Contents

module HaveAPI::GoClient
  module Parameters ; end

  module Parameter
    # @param klass [Class]
    # @param block [Proc]
    def self.register(klass, block)
      @handlers ||= []
      @handlers << [klass, block]
    end

    # @param role [Symbol]
    # @param direction [Symbol]
    # @param io [InputOutput]
    # @param name [String]
    # @param desc [Hash]
    # @return [Parameters::Base, nil]
    def self.new(role, direction, io, name, desc)
      klass, _ =
        @handlers.select do |klass, block|
          block.call(role, direction, name, desc)
        end.first

      klass ? klass.new(io, name, desc) : nil
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
haveapi-go-client-0.20.0 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.19.3 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.19.2 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.19.1 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.19.0 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.18.2 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.18.1 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.18.0 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.17.0 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.16.3 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.16.2 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.16.1 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.16.0 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.15.1 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.15.0 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.14.2 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.14.1 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.14.0 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.13.3 lib/haveapi/go_client/parameter.rb
haveapi-go-client-0.13.2 lib/haveapi/go_client/parameter.rb