Module: Carbon::ClassMethods
- Defined in:
- lib/carbon.rb
Overview
Mixed into any class that includes Carbon.
Instance Method Summary collapse
-
#emit_as(emitter, &blk) ⇒ nil
DSL for declaring how to represent this class an an emitter.
Instance Method Details
#emit_as(emitter, &blk) ⇒ nil
DSL for declaring how to represent this class an an emitter.
See also Registry::Registrar#provide.
You get this when you include Carbon in a class.
191 192 193 194 195 |
# File 'lib/carbon.rb', line 191 def emit_as(emitter, &blk) emitter = emitter.to_s.singularize.camelcase registrar = Registry::Registrar.new self, emitter registrar.instance_eval(&blk) end |