Class: Chef::TidyServer

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/tidy_server.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root_url) ⇒ TidyServer

Returns a new instance of TidyServer.



5
6
7
# File 'lib/chef/tidy_server.rb', line 5

def initialize(root_url)
  @root_url = root_url
end

Instance Attribute Details

#root_urlObject

Returns the value of attribute root_url.



3
4
5
# File 'lib/chef/tidy_server.rb', line 3

def root_url
  @root_url
end

Class Method Details

.from_chef_server_url(url) ⇒ Object



9
10
11
12
# File 'lib/chef/tidy_server.rb', line 9

def self.from_chef_server_url(url)
  url = url.gsub(%r{/organizations/+[^/]+/*$}, "")
  Chef::Server.new(url)
end