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.
Class Method Summary collapse
- .extended(base) ⇒ Object private
Instance Method Summary collapse
-
#app_name ⇒ String
private
Application name.
-
#configure(&block) ⇒ Object
private
Configure the application.
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.
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_name ⇒ String
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
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
56 57 58 59 60 |
# File 'lib/mooncell/application.rb', line 56 def configure(&block) @_lock.synchronize do @configuration = ApplicationConfiguration.new(&block) end end |