Class: Monolens::Macros
- Inherits:
-
Object
- Object
- Monolens::Macros
- Defined in:
- lib/monolens/macros.rb
Instance Method Summary collapse
- #factor_lens(namespace_name, lens_name, options, registry) ⇒ Object
-
#initialize(macros, registry) ⇒ Macros
constructor
A new instance of Macros.
Constructor Details
#initialize(macros, registry) ⇒ Macros
Returns a new instance of Macros.
3 4 5 6 |
# File 'lib/monolens/macros.rb', line 3 def initialize(macros, registry) @macros = macros @registry = registry end |
Instance Method Details
#factor_lens(namespace_name, lens_name, options, registry) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/monolens/macros.rb', line 8 def factor_lens(namespace_name, lens_name, , registry) if defn = @macros[lens_name] instantiate_macro(defn, ) else raise Error, "No such lens #{[namespace_name, lens_name].join('.')}" end end |