Class: Coconut::Dsl::Application
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- Coconut::Dsl::Application
- Defined in:
- lib/coconut/dsl/application.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(current_environment) ⇒ Application
constructor
A new instance of Application.
- #run(&config) ⇒ Object
Methods inherited from BlankSlate
Constructor Details
#initialize(current_environment) ⇒ Application
Returns a new instance of Application.
12 13 14 |
# File 'lib/coconut/dsl/application.rb', line 12 def initialize(current_environment) @current_environment = current_environment end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(asset, *args, &config) ⇒ Object (private)
36 37 38 39 |
# File 'lib/coconut/dsl/application.rb', line 36 def method_missing(asset, *args, &config) ::Kernel::raise InvalidName, "#{asset} can't be used as asset name" if _taken?(asset) @assets_config[asset] = Asset.configure(@current_environment, &config) end |
Class Method Details
.configure(current_environment, &config) ⇒ Object
8 9 10 |
# File 'lib/coconut/dsl/application.rb', line 8 def self.configure(current_environment, &config) new(current_environment).run(&config) end |