Module: Mooncell::Application::ClassMethods Private

Defined in:
lib/mooncell/application.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/mooncell/application.rb', line 24

def self.extended(base)
  super
  base.class_eval do
    @_lock = Mutex.new

    class << self
      # @since 0.1.0
      # @api private
      attr_reader :configuration
    end
  end
end

Instance Method Details

#app_nameString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Application name

Returns:

  • (String)

    the application name

Since:

  • 0.1.0



43
44
45
46
# File 'lib/mooncell/application.rb', line 43

def app_name
  @app_name ||=
    name.split('::').first.downcase
end

#configure(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Configure the application

TODO: Support specify by environment

Parameters:

  • block (Proc)

    the configuration block

Since:

  • 0.1.0



56
57
58
59
60
# File 'lib/mooncell/application.rb', line 56

def configure(&block)
  @_lock.synchronize do
    @configuration = ApplicationConfiguration.new(&block)
  end
end