Module: Cloudflare

Defined in:
lib/cloudflare/version.rb,
lib/cloudflare.rb,
lib/cloudflare/dns.rb,
lib/cloudflare/logs.rb,
lib/cloudflare/user.rb,
lib/cloudflare/zones.rb,
lib/cloudflare/accounts.rb,
lib/cloudflare/firewall.rb,
lib/cloudflare/paginate.rb,
lib/cloudflare/connection.rb,
lib/cloudflare/kv/wrapper.rb,
lib/cloudflare/kv/namespaces.rb,
lib/cloudflare/representation.rb,
lib/cloudflare/custom_hostnames.rb,
lib/cloudflare/custom_hostname/ssl_attribute.rb,
lib/cloudflare/custom_hostname/ssl_attribute/settings.rb

Overview

Released under the MIT License. Copyright, 2018-2024, by Samuel Williams. Copyright, 2019, by Rob Widmer.

Defined Under Namespace

Modules: DNS, Firewall, KV, Logs, Paginate Classes: Account, Accounts, Connection, CustomHostname, CustomHostnames, Representation, RequestError, User, Wrapper, Zone, Zones

Constant Summary collapse

VERSION =
"4.4.0"

Class Method Summary collapse

Class Method Details

.connect(*arguments, **auth_info) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/cloudflare.rb', line 16

def self.connect(*arguments, **auth_info)
	connection = Connection.open(*arguments)
	
	if !auth_info.empty?
		connection = connection.authenticated(**auth_info)
	end
	
	return connection unless block_given?
	
	Sync do
		yield connection
	ensure
		connection.close
	end
end