Sha256: 7e1752c588fc45ed19c34e54e6d7c62fb24c97a38731af2ee16b62501d895749
Contents?: true
Size: 834 Bytes
Versions: 40
Compression:
Stored size: 834 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' require 'avm/instances/base' require 'httpclient' module EhbrsRubyUtils module WebUtils class Instance < ::Avm::Instances::Base def root_url read_entry(:url) end def resource_url(resource_url_suffix) root_url + '/' + resource_url_suffix.gsub(%r{\A/+}, '') end def http_request(resource_url_suffix, options = {}) method = options.delete(:method) || 'get' url = resource_url(resource_url_suffix) http_client.request(method, url, options) end def http_client_uncached client = HTTPClient.new client.force_basic_auth = true client.set_basic_auth(root_url, read_entry(:admin_username), read_entry(:admin_password)) client end end end end
Version data entries
40 entries across 40 versions & 2 rubygems