Sha256: f1684fea9748c91455974daba0cf81b840083dbec3cf4b680c9f896870efc732

Contents?: true

Size: 802 Bytes

Versions: 28

Compression:

Stored size: 802 Bytes

Contents

require 'apipie_bindings'
require 'hammer_cli/ssloptions'

module HammerCLI::Apipie
  class ApiConnection < HammerCLI::AbstractConnector
    attr_reader :api

    def initialize(params, options = {})
      @logger = options[:logger]
      @api = ApipieBindings::API.new(params, HammerCLI::SSLOptions.new.get_options(params[:uri]))
      if options[:reload_cache]
        @api.clean_cache
        HammerCLI.clear_cache
        unless @logger.nil?
          @logger.debug 'Apipie cache was cleared'
          @logger.debug 'Completion cache was cleared'
        end
      end
    end

    def resources
      @api.resources
    end

    def resource(resource_name)
      @api.resource(resource_name)
    end

    def has_resource?(resource_name)
      @api.has_resource?(resource_name)
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
hammer_cli-3.13.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.12.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.10.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.9.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.8.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.7.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.5.1 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.6.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.5.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.4.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.3.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.2.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.1.1 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.0.2 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.1.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.0.1 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-3.0.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-2.5.1 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-2.5.0 lib/hammer_cli/apipie/api_connection.rb
hammer_cli-2.3.1 lib/hammer_cli/apipie/api_connection.rb