Class: QAT::Reporter::Xray::Publisher::Base::Client

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/qat/reporter/xray/publisher/base.rb

Overview

REST Base Client implementation

Defined Under Namespace

Classes: ConnectionError, NoConnectionFound, ServiceUnavailableError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_uri) ⇒ RestClient::Response

Returns a new REST Base Client



109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/qat/reporter/xray/publisher/base.rb', line 109

def initialize(base_uri)
  #sets the ip:port/base_route
  @base_uri = case base_uri
                when Hash
                  URI::HTTP.build(base_uri).to_s
                when URI::HTTP
                  base_uri.to_s
                when String
                  base_uri
                else
                  raise ArgumentError.new "Invalid URI class: #{base_uri.class}"
              end
end

Instance Attribute Details

#base_uriObject (readonly)

Returns the value of attribute base_uri.



105
106
107
# File 'lib/qat/reporter/xray/publisher/base.rb', line 105

def base_uri
  @base_uri
end