Class: Detroit::Toolchain::Script::ERBContext
- Defined in:
- lib/detroit/toolchain/script.rb
Overview
ERBContext provides the clean context to process a Routine as an ERB template.
Instance Method Summary collapse
-
#__binding__ ⇒ Object
Access to a clean binding.
-
#initialize(project) ⇒ ERBContext
constructor
A new instance of ERBContext.
- #method_missing(name, *args) ⇒ Object
-
#project ⇒ Object
Provide access to project data.
Constructor Details
#initialize(project) ⇒ ERBContext
Returns a new instance of ERBContext.
130 131 132 |
# File 'lib/detroit/toolchain/script.rb', line 130 def initialize(project) @project = project end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
145 146 147 148 149 150 151 152 153 |
# File 'lib/detroit/toolchain/script.rb', line 145 def method_missing(name, *args) if project.respond_to?(name) project.__send__(name, *args) elsif project..respond_to?(name) project..__send__(name, *args) else super(name, *args) end end |
Instance Method Details
#__binding__ ⇒ Object
Access to a clean binding.
135 136 137 |
# File 'lib/detroit/toolchain/script.rb', line 135 def __binding__ binding end |
#project ⇒ Object
Provide access to project data.
140 141 142 |
# File 'lib/detroit/toolchain/script.rb', line 140 def project @project end |