require 'chamber/rubinius_fix'
require 'chamber/instance'
require 'chamber/rails'

module  Chamber
  extend self

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

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

  def env
    instance.settings
  end

  protected

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

  def instance=(new_instance)
    @@instance = new_instance
  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
end

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

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

  def instance=(new_instance)
    @@instance = new_instance
  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

Convert 'extend self' to 'module_function'
Style: Convert 'extend self' to 'module_function'

--------------------------------------------------------------------------------
Change-Id:     I706c404fae374cd39acf66131b099dd1ebf91296
Signed-off-by: Jeff Felchner <8a84c204e2d4c387d61d20f7892a2bbbf0bc8ae8@thekompanee.com>
