Class: Cup::Cupfile::DSL
- Inherits:
- BasicObject
- Defined in:
- lib/cup/cupfile.rb
Defined Under Namespace
Classes: JavascriptsDSL
Class Method Summary collapse
Instance Method Summary collapse
- #after_build(&block) ⇒ Object
-
#before_build(&block) ⇒ Object
block cachers.
-
#initialize(cupfile) ⇒ DSL
constructor
A new instance of DSL.
- #javascripts(&block) ⇒ Object
-
#m ⇒ Object
DSL members setters.
Constructor Details
#initialize(cupfile) ⇒ DSL
Returns a new instance of DSL.
99 100 101 |
# File 'lib/cup/cupfile.rb', line 99 def initialize cupfile @cupfile = cupfile end |
Class Method Details
.interpret(cupfile, &block) ⇒ Object
94 95 96 97 |
# File 'lib/cup/cupfile.rb', line 94 def self.interpret cupfile, &block new(cupfile).instance_eval &block cupfile end |
Instance Method Details
#after_build(&block) ⇒ Object
112 113 114 |
# File 'lib/cup/cupfile.rb', line 112 def after_build &block @cupfile.instance_variable_set :@after_build, block end |
#before_build(&block) ⇒ Object
block cachers
108 109 110 |
# File 'lib/cup/cupfile.rb', line 108 def before_build &block @cupfile.instance_variable_set :@before_build, block end |
#javascripts(&block) ⇒ Object
103 104 105 |
# File 'lib/cup/cupfile.rb', line 103 def javascripts &block JavascriptsDSL.interpret @cupfile, &block end |
#m ⇒ Object
DSL members setters
88 89 90 91 92 |
# File 'lib/cup/cupfile.rb', line 88 %W{version name licence}.each do |m| define_method m do |value| @cupfile.instance_variable_set "@#{m}", value end end |