Module: Tanshuku

Defined in:
lib/tanshuku.rb,
lib/tanshuku/engine.rb,
lib/tanshuku/version.rb,
app/models/tanshuku/url.rb,
lib/tanshuku/configuration.rb,
app/controllers/tanshuku/urls_controller.rb,
lib/generators/tanshuku/install_generator.rb

Overview

Tanshuku’s namespace.

Defined Under Namespace

Classes: Configuration, Engine, InstallGenerator, Url, UrlsController

Constant Summary collapse

VERSION =
"3.0.3"

Class Method Summary collapse

Class Method Details

.configTanshuku::Configuration

Note:

Mutating a Configuration object is thread-unsafe. It is recommended to use configure for configuration.

Returns a configuration object for Tanshuku.



16
17
18
19
20
21
# File 'lib/tanshuku.rb', line 16

def self.config
  # Disable this cop but use `Tanshuku::Configuration#configure` for thread-safety.
  # rubocop:disable ThreadSafety/InstanceVariableInClassMethod
  @config ||= Configuration.new
  # rubocop:enable ThreadSafety/InstanceVariableInClassMethod
end

.configure {|config| ... } ⇒ void

Note:

This method is thread-safe. When mutating a Configuration object for configuration, it is recommended to use this method.

This method returns an undefined value.

Configures Tanshuku.

Examples:

Tanshuku.configure do |config|
  config.default_url_options = { host: "localhost", protocol: :https }
end

Yield Parameters:

Yield Returns:

  • (void)


38
39
40
# File 'lib/tanshuku.rb', line 38

def self.configure(&)
  config.configure(&)
end