Module: Cloudflared

Defined in:
lib/cloudflared.rb,
lib/cloudflared/error.rb,
lib/cloudflared/client.rb,
lib/cloudflared/config.rb,
lib/cloudflared/object.rb,
lib/cloudflared/version.rb,
lib/cloudflared/resource.rb,
lib/cloudflared/collection.rb,
lib/cloudflared/objects/image.rb,
lib/cloudflared/resources/images.rb

Defined Under Namespace

Classes: Client, Collection, Config, Error, Image, ImagesResource, Object, Resource

Constant Summary collapse

VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.clientObject

Creates a client instance with pre-configured values



22
23
24
25
26
27
28
29
30
# File 'lib/cloudflared.rb', line 22

def self.client
  Cloudflared::Client.new(
    api_key: config.api_key,
    account_id: config.,
    images_hash: config.images_hash,
    images_default_key: config.images_default_key,
    adapter: config.adapter || Faraday.default_adapter
  )
end

.configObject

Returns Cloudflared's configuration object.



17
18
19
# File 'lib/cloudflared.rb', line 17

def self.config
  @config ||= Cloudflared::Config.new
end

.configure {|config| ... } ⇒ Object

Lets you set global configuration options.

All available options and their defaults are in the example below:

Examples:

Initializer for Rails

Cloudflared.configure do |config|
  config.api_key      = "key"
  config.   = "secret"
  config.images_hash  = "hash"
  config.images_default_key  = "key"
  config.adapter      = Faraday.default_adapter
end

Yields:



43
44
45
# File 'lib/cloudflared.rb', line 43

def self.configure(&block)
  yield(config) if block
end