Class: Artifactory::Resource::URLBase

Inherits:
Base
  • Object
show all
Defined in:
lib/artifactory/resources/url_base.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attribute, attributes, #attributes, #client, #client=, #client?, #extract_client!, extract_client!, find_from_config, #format_repos!, format_repos!, from_hash, from_url, has_attribute?, #initialize, #inspect, list_from_config, #set, #to_hash, #to_json, #to_matrix_properties, #to_query_string_parameters, #to_s, #url_safe, url_safe

Constructor Details

This class inherits a constructor from Artifactory::Resource::Base

Class Method Details

.all(options = {}) ⇒ Array<Resource::URLBase>

List UrlBase in the system configuration.

Parameters:

  • options (Hash) (defaults to: {})

    the list of options

Options Hash (options):

Returns:



34
35
36
37
# File 'lib/artifactory/resources/url_base.rb', line 34

def all(options = {})
  config = Resource::System.configuration(options)
  simple_text_from_config("config/urlBase", config, options)
end

.find(url, options = {}) ⇒ Resource::MailServer?

Find (fetch) the url base.

Examples:

Find a URLBase by its url_base.

url_base.find('http://33.33.33.20/artifactory') #=> #<URLBase url_base: 'http://33.33.33.20/artifactory' ...>

Parameters:

  • url (String)

    the base url to find

  • options (Hash) (defaults to: {})

    the list of options

Options Hash (options):

Returns:

  • (Resource::MailServer, nil)

    an instance of the mail server that matches the given host, or nil if one does not exist



57
58
59
60
61
62
63
64
# File 'lib/artifactory/resources/url_base.rb', line 57

def find(url, options = {})
  config = Resource::System.configuration(options)
  find_from_config("config/urlBase[text()='#{url}']", config, options)
rescue Error::HTTPError => e
  raise unless e.code == 404

  nil
end

Instance Method Details

#url_baseObject

Return this object’s url_base

Returns:

  • (Object)


90
# File 'lib/artifactory/resources/url_base.rb', line 90

attribute :url_base, -> { raise "URL base missing!" }

#url_base=(value) ⇒ Object

Set this object’s url_base

Parameters:

  • value (Object)

    the value to set for url_base

  • default (Object)

    the default value for this attribute



90
# File 'lib/artifactory/resources/url_base.rb', line 90

attribute :url_base, -> { raise "URL base missing!" }

#url_base?Boolean

Determines if the url_base value exists and is truthy

Returns:

  • (Boolean)


90
# File 'lib/artifactory/resources/url_base.rb', line 90

attribute :url_base, -> { raise "URL base missing!" }