Sha256: 29cc8bbfcebcb4f6b8b2ef14891010aa0098633e4605ac4c8b99b3338374835e

Contents?: true

Size: 858 Bytes

Versions: 5

Compression:

Stored size: 858 Bytes

Contents

# frozen_string_literal: true
require 'chamber/rubinius_fix'
require 'chamber/instance'
require 'chamber/rails'

module  Chamber
  def load(options = {})
    self.instance = Instance.new(options)
  end

  def to_s(options = {})
    instance.to_s(options)
  end

  def env
    instance.settings
  end

  protected

  attr_accessor :instance

  def instance
    @instance ||= Instance.new({})
  end

  public

  def method_missing(name, *args)
    return instance.public_send(name, *args) if instance.respond_to?(name)

    super
  end

  def respond_to_missing?(name, include_private = false)
    instance.respond_to?(name, include_private)
  end

  module_function :load,
                  :to_s,
                  :env,
                  :instance,
                  :instance=,
                  :method_missing,
                  :respond_to_missing?
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chamber-2.10.2 lib/chamber.rb
chamber-2.10.1 lib/chamber.rb
chamber-2.10.0 lib/chamber.rb
chamber-2.9.1 lib/chamber.rb
chamber-2.9.0 lib/chamber.rb