module Ravioli

The root namespace for all of Ravioli, and owner of two handly configuration-related class methods

Constants

VERSION

Public Class Methods

build(namespace: nil, class_name: "Configuration", strict: false) { |builder| ... } click to toggle source

Forwards arguments to a {Ravioli::Builder}. See {Ravioli::Builder#new} for complete documentation.

@param namespace [String, Module, Class] the name of, or a direct reference to, the module or class your Configuration class should namespace itself within @param class_name [String] the name of the namespace's Configuration class @param strict [boolean] whether or not the Builder instance should throw errors when there are errors loading configuration files or encrypted credentials

# File lib/ravioli.rb, line 20
def build(namespace: nil, class_name: "Configuration", strict: false, &block)
  builder = Builder.new(
    class_name: class_name,
    hijack: true,
    namespace: namespace,
    strict: strict,
  )
  yield builder if block
  builder.build!
end
configurations() click to toggle source

Returns a list of all of the configuration instances

# File lib/ravioli.rb, line 32
def configurations
  @configurations ||= []
end
default() click to toggle source

Returns the most-recently configured Ravioli instance that has been built with {Ravioli::build}.

# File lib/ravioli.rb, line 37
def default
  configurations.last
end